Runscript

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

会继续执行到新脚本,如同呼叫脚本的扩展。

使用 Runscript 的其中一个好处就是可以创建较小的脚本而不是一个大脚本。

Dependencies

  • 主脚本和子脚本必须包含在同一个文件夹中。
  • 主脚本和子脚本必须为相同类型。例如,如果主脚本是电话脚本,则子脚本也必须是电话脚本。
  • 主脚本和子脚本的 ContactID 也将是相同的。
  • Runscript 触发子脚本后,主脚本将执行传递给第二个脚本,并不再运行。如果希望两个脚本同时运行,请使用 Spawn action。第一个脚本中的所有变量在第二个脚本中都会保持不变。
  • 如果您计划运行另一个脚本并在完成后返回到第一个脚本,包括能够传递和返回值(类似于编程子例程),请使用 Runsub action
  • Runscript 触发子脚本时,主脚本会终止。
  • RunScript SpawnRunsub 或类似脚本调用的所有脚本必须有效且处于活动状态。在保存过程中,Studio 会验证操作调用的所有脚本。如果其中任何一个无效或不活动,Studio 将显示错误,并且您将无法保存。

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.

通用

电子邮件 聊天 电话 语音信箱 工作项目 短信 数字

Comparison of Similar Actions

以下操作具有类似功能,但存在一些关键区别:

  • Runscript:当 Runscript 触发子脚本时,无法从子脚本返回到第一个脚本。
  • Runsub:当 Runsub 触发子脚本时,只要该子脚本有 Return 操作,脚本就可以返回到第一个脚本。当子脚本完成时, Return 操作会将一个值返回给 Runsub 操作。

Input Properties

这些属性定义操作在执行时使用的数据。

属性

说明

说明文字

输入在脚本中唯一标识此操作的短语。标题显示在脚本画布上的操作图标下方。The default is the action name.

ScriptName

您希望生成的脚本。您可以单击位于操作属性框顶部的 Choose Script 链接,以选择为您的业务单位存储的脚本。

Result Branch Conditions

None

Script Example

此示例并非完整的脚本。要使用此操作,需要额外的脚本编写工作。

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 ID关闭 分配给每个联系人的唯一数字标识符 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?