Runsub

The Runsub action icon, a curled piece of paper with two arrows pointing to the right next to it at the top and bottom.

하위 스크립트를 호출하며 이 하위 스크립트는 실행된 후 Return action을(를) 사용하여 기본 스크립트로 돌아가 기본 스크립트를 계속 호출합니다. 하위 스크립트는 실행되면 Return 작업의 ReturnValue 속성에 값을 저장한 다음 이 값을 기본 스크립트의 Runsub 작업에 있는 ReturnVariable 속성으로 다시 전달합니다.

이 작업을 사용하여 하나 이상의 큰 스크립트를 작은 스크립트로 나눌 수 있습니다.

Dependencies

  • 기본 스크립트와 하위 스크립트는 같은 폴더에 있어야 합니다.

  • 기본 스크립트 유형과 하위 스크립트 유형이 동일해야 합니다. 예를 들어, 기본 스크립트가 전화 스크립트인 경우 하위 스크립트도 전화 스크립트여야 합니다.
  • 기본 스크립트에 Runsub 작업을 배치하면, 하위 스크립트에는 반드시 Return 작업이 있어야 합니다.
  • Runsub은(는) 기본 스크립트에서 하위 스크립트로 여러 변수를 전달할 수 있지만 하위 스크립트는 기본 스크립트에 하나의 값(ReturnVariable 속성의)만 반환할 수 있습니다.
  • 하위 스크립트에 정의된 모든 변수는 하위 스크립트가 종료되면 더 이상 사용할 수 없습니다.
  • RunScript , Spawn, Runsub, 또는 유사한 스크립트에 의해 호출되는 모든 스크립트는 유효하며 활성 상태여야 합니다. 저장 프로세스 중에 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

다음 작업에는 유사한 기능이 있지만 주요 차이점이 있습니다.

  • RunscriptRunscript이(가) 하위 스크립트를 트리거하면, 하위 스크립트에서 처음 스크립트로 돌아가는 방법은 없습니다.
  • Runsub: Runsub이(가) 하위 스크립트를 트리거하면, 해당 하위 스크립트에 Return 작업이 있는 한 스크립트는 첫 번째 스크립트로 돌아갈 수 있습니다. Return 작업은 하위 스크립트가 완료되면 Runsub 작업에 값을 반환합니다.

Input Properties

이러한 속성은 실행할 때 작업이 사용하는 데이터를 정의합니다.

속성

설명

캡션 추가

스크립트에서 이 작업을 고유하게 식별하는 짧은 문구를 입력합니다. 캡션은 스크립트 캔버스의 작업 아이콘 아래에 표시됩니다. The default is the action name.

ScriptName

생성할 스크립트입니다. Choose Script 링크를 작업의 속성 박스 상단에서 클릭하여 사업부를 위해 저장된 스크립트를 선택할 수 있습니다.

ReturnVariable

기본 스크립트에 반환되는 값은 이 속성에 저장됩니다. 여러 값을 전달하려면 배열을 변수로 사용합니다.
Parameters

필드에서 줄임표 아이콘을 클릭하고 생성된 스크립트에 보낼, 각 매개변수에 대한 변수를 추가합니다. 편집기 창에서 한 줄에 하나의 변수를 입력합니다. 의미 있는 변수 이름을 사용하십시오. 변수 이름은 생성된 스크립트에 사용된 해당 변수의 이름과 일치하지 않아도 됩니다.

스크립트에 전달된 매개변수는 Begin 작업에서 해당 스크립트의 추적 출력에 나타납니다.

결과 브랜치 조건

결과 브랜치 조건을 사용하면 작업이 실행될 때 여러 결과를 처리하기 위해 스크립트에 브랜치를 생성할 수 있습니다.

조건

설명

Default

다른 분기를 사용하기를 요구하는 조건을 스크립트가 충족하지 않는다면 사용되는 경로입니다. 작업의 다른 분기가 정의되지 않았을 때도 사용되는 경로입니다.

OnError

작업이 올바로 실행되지 않을 때 사용되는 경로. 예를 들어, 연결 불량, 구문 오류 등 예기치 않은 문제가 있을 때 사용됩니다. _ERR 변수(밑줄 문자 하나 포함)는 문제의 요약 설명으로 채워져야 합니다.

Script Example

이 예시는 완전한 스크립트가 아닙니다. 이 작업을 사용하려면 추가 스크립팅 작업이 필요합니다.

In the main script below (shown top), when the script is triggered, the Runsub action immediately triggers the subscript (shown bottom). In the subscript, Voiceparams sets the Text-to-Speech settings, and the Hours action sets branches for open, closed, and holiday to three different Return actions. When the subscript is finished, the values in the ReturnValues property (in the Return action) are stored in the ReturnVariable field (Runsub action in the main script). The Case action then sets the open, closed, and holiday branches as appropriate.

Main Script

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?

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.

The three Return actions provide values in the ReturnValue property so the Case action in the main script can determine which branch to follow.

Would you like to download this script?