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.

Runscript and Runsub are similar, but have slightly different functions. When Runscript triggers a subscript, there's no way to return to the first script from the subscript. 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.

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

Properties

Property Details
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 stored for your business unit.

Branches

None

Tips & Tricks

  • One of the benefits of using Runscript is that you can create smaller scripts instead of having one large script.
  • 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.
  • The main script will terminate when Runscript triggers the subscript.

Phone Script Example Using Runscript

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?