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.

一般

電郵 聊天 電話 語音郵件 工作項目 SMS 數位

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 IDClosed 指派給每個聯絡的唯一數字識別碼 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?