Runscript

The icon for the Runscript action - a curved piece of paper.

Continues script execution to a new script as if it were an extension of the calling script.

One of the benefits of using Runscript is that you can create smaller scripts instead of having one large script.

Dependencies

  • The main script and the subscript must be contained in the same folder.
  • The main script type and the subscript type must be the same. For example, if the main script is a phone script, the subscript must also be a phone script.
  • The ContactID will be the same for both the main script and the subscript.
  • After Runscript triggers the subscript, the main script passes execution to the second script and no longer runs. If you want both scripts to run simultaneously, use a Spawn action. All variables from the first script are left intact in the second script.
  • If you intend to run another script and return to the first script upon completion, including the ability to pass and return values (like a programming subroutine), use Runsub action.
  • The main script will terminate when Runscript triggers the subscript.
  • All scripts called by RunScript , Spawn, Runsub, or similar scripts must be valid and active. During the save process, Studio validates all scripts called by actions. If any of them are invalid or inactive, Studio displays an error and you won't be able to save.

Supported Script Types

The icon for a Generic script type - a rectangle with < and > symbols inside it.

The icon for the Email script type - a large @ symbol in a diamond.

The icon for the Chat script type - a chat bubble with an ellipsis inside (...), in a diamond shape.

The icon for the Phone script type - an old-style phone handset with curved lines indicating sound coming out of it.

The icon for the Voicemail script type - a symbol that looks like a cassette tape - two circles sitting on a horizontal line.

The icon for the Work Item script type-a piece of paper with one corner folded down and a bullet list on it.

The icon for the SMS script type - a smart phone with a chat bubble coming out of it.

The icon for the Digital script type - a computer monitor with a smartphone next to it.

Generic

Email Chat Phone Voicemail Work Item SMS Digital

Comparison of Similar Actions

The following actions have similar functions, but with some key differences: 

  • Runscript: When Runscript triggers another script, it doesn't return to the first script from the second script.
  • Runsub: When Runsub triggers a subscript, the script can return to the first script, as long as the subscript has a Return action. The Return action provides a value back to the Runsub action when the subscript is finished.
  • SPAWN: Starts a second script that runs in parallel to the first script. Spawned scripts cannot pass data back to the first script unless you include a SIGNAL action in the spawned script.

Input Properties

These properties define data that the action uses when executing.

Property

Description

Caption

Enter a short phrase that uniquely identifies this action in the script. The caption appears on the script canvas under the action icon. The default is the action name.

ScriptName

The script you want to spawn. You can click the Choose Script link at the top of the action's properties box to select a script from your business unit.

Result Branch Conditions

None

Script Example

This is an example to show how this action can be used in scripts. It is not intended to be a complete script. Additional scripting may be required.

The following example is a part of a much larger script. In this example, Runsub triggers a different script, in which the Return action enables the Case action in the script below to determine whether the organization is open, closed, or on holiday. If it is determined that the office is closed or on holiday, a Play action will play a specific message (either a closed message or a holiday message). The Runscript will then terminate the script and trigger the subscript.

An example script, showing Studio actions with arrows connecting them. Each action has a label beneath it to indicate what the action does in the script.

Would you like to download this script?

The subscript that Runscript triggers is shown below. The script enables the contact to leave a message. The main script passed a variable with the caller ID and contact IDClosed A unique numerical identifier assigned to each contact to the subscript, which enables the contact to leave a message, review a message, take corrective action if no voice was heard, or to enable the contact to re-record their message.

An example script, showing Studio actions with arrows connecting them. Each action has a label beneath it to indicate what the action does in the script.

Would you like to download this script?