runScript

This command is currently not yet fully supported for custom scripts, we are working on making this available as soon as possible.

The runScript the command allows you to call a JavaScript file from within your flow.

Examples

To run another flow configured in Moropo

- runScript:
    file: javascript.js   # name of the javascript file in Moropo + .js

Use within your script

- launchApp
...
- runScript:
    file: javascript.js
...

Passing environment variables

- runScript:
    file: javascript.js
    env:
      SOME_KEY: "my value"

Outputs

The results of a runScript can returned and accessed later in a flow.

Consider a javascript file which returns two unique strings of text

// javascript.js
output.result1 = 'foo'
output.result2 = 'bar'

These could then be accessed later in the flow

- runScript:
    file: javascript.js
- inputText: ${output.result1}
- tapOn:
    text: ${output.result2}

Last updated