{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/zh/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"运行 JS 脚本","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"运行-js-脚本","__idx":0},"children":["运行 JS 脚本"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"参数","__idx":1},"children":["参数"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["添加参数"]},"：您可以添加变量。变量名可以在下一步的脚本中直接验证。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["运行 JS 脚本"]},"：您可以在此处添加 JavaScript 脚本。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["输出格式"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["字符串"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["整数"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["数字"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["布尔值"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ElementObject"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["这些字段是什么意思？"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"输出","__idx":2},"children":["输出"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["输出参数"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["脚本的输出结果。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["执行日志"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["开始时间"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["结束时间"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["持续时间（毫秒）"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["状态（成功/失败）"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"示例","__idx":3},"children":["示例"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["示例 1：设置一个随机数。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["示例 2：解析元素内容。"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!TIP]"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["您可以将项目中生成的变量直接传递给 AI 以生成脚本。提示：“{} 这段 JSON 内容，我想通过 JavaScript 提取 name 字段的内容，并最终输出 name 的值。”"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"相关节点","__idx":4},"children":["相关节点"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["键盘操作"]}]},"headings":[{"value":"运行 JS 脚本","id":"运行-js-脚本","depth":1},{"value":"参数","id":"参数","depth":2},{"value":"输出","id":"输出","depth":2},{"value":"示例","id":"示例","depth":2},{"value":"相关节点","id":"相关节点","depth":2}],"frontmatter":{"seo":{"title":"运行 JS 脚本"}},"lastModified":"2026-06-10T11:47:34.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/zh/rparobotic-process-automation/03-node/02-data-processing/01-run-js-script","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}