ScriptTap
SetVariable

Command video guide

SetVariable

SetVariable creates or assigns typed values for later commands: counts, text, condition flags, colors and times. This overview tours the editor without a separate runtime demo. Use the focused tabs for genuine Play and visible result confirmations.

Manually drag SetVariable from Variables into a script, then open the placed row. Single writes one named variable. Use a valid name such as i1 for an Integer example; the gray placeholder is only a hint. Put a writer before its readers, and use the type and scope expected by those readers.

Use In offers This Script Only and Script Thread. The first is script-local; the second supports sharing within the related script-play chain. It is not a permanent global value across unrelated runs. The tour keeps This Script Only.

Integer is for whole-number counts and coordinates. Decimal is for fractional or measured values; the editor shows accepted numeric spellings. Boolean is True/False for flags and conditions, not a String containing those words. Hex is for supported hexadecimal values, commonly six-digit colors. String stores text for typing, prompts, comparisons and processing. Time stores supported clock/date values for Time-aware commands.

String Single includes Set from clipboard. It uses clipboard input instead of manual text and requires consent. This tour leaves it off and never reads or displays clipboard contents.

Array uses one array letter and Capacity, not a numbered destination such as v1. Capacity accepts 1–4096 or a prior Integer variable. Ordinary Array mode declares a typed collection; explicit Time Generator modes can initialize every entry from one source. The Array and time-specific Array tabs show actual workflows.

For Time, Literal provides direct entry. Time Generator adds format and source controls. Manual AM/PM Format declares Time: Clock has separate numeric Hours/Minutes/Seconds and AM/PM; Whole Time accepts a supported complete literal, optional date, or prior Time variable. These presentations keep separate editor drafts. See Manual · Single and Manual · Array for syntax and real results.

Use Current samples when Play reaches the command, not while editing. Manual input is absent in that source. Array entries use the sampled value. Unix Time declares Decimal epoch seconds, with milliseconds as a fractional part: it is not a Time variable or a millisecond count. It also supports manual and current sources, with Single/Array examples in the Unix tabs.

Incompatible type/format changes can clear fields that no longer apply. Complete the selected mode before playback. The tour returns to a valid basic Integer Single, enters i1 = 7, keeps This Script Only and saves, without pressing Play. Choose the appropriate focused tab to see a useful runtime example.

Overview

Step-by-step guide

  1. Step 01

    SetVariable creates or assigns values that later commands can use. Store a count, text, a color, a condition flag, or a time instead of entering the same information repeatedly. This overview explains the editor options. The other tabs provide focused, real playback examples.

    SetVariable: Overview step 1: SetVariable creates or assigns values that later commands can use. Store a count, text, a color, a condition flag, or a time instead of entering the same information repeatedly. This overview explains the editor options. The other tabs provide focused, real playback examples.
  2. Step 02

    Drag SetVariable from the Variables palette into the script, then open the placed command. Choose its destination, type, source, and scope before using the value later.

    SetVariable: Overview step 2: Drag SetVariable from the Variables palette into the script, then open the placed command. Choose its destination, type, source, and scope before using the value later.
  3. Step 03

    Single writes one named variable. Enter a valid ScriptTap name, such as i1 for an Integer example, and provide the required value. The gray name is a hint, not a variable you have already created. Put this writer before the commands that read its result.

    SetVariable: Overview step 3: Single writes one named variable. Enter a valid ScriptTap name, such as i1 for an Integer example, and provide the required value. The gray name is a hint, not a variable you have already created. Put this writer before the commands that read its result.
  4. Step 04

    Use In selects the variable scope: This Script Only or Script Thread. The first keeps the value local to this script; Script Thread is for sharing within the related script-play chain. It is not a permanent global value for unrelated runs. Match the scope used by later consumers.

    SetVariable: Overview step 4: Use In selects the variable scope: This Script Only or Script Thread. The first keeps the value local to this script; Script Thread is for sharing within the related script-play chain. It is not a permanent global value for unrelated runs. Match the scope used by later consumers.
  5. Step 05

    Variable Type determines what the value means. Integer is for whole numbers, such as counts or coordinates. The list also contains Decimal, Boolean, Hex, String, and Time. Choose the type required by the commands that will read this variable.

    SetVariable: Overview step 5: Variable Type determines what the value means. Integer is for whole numbers, such as counts or coordinates. The list also contains Decimal, Boolean, Hex, String, and Time. Choose the type required by the commands that will read this variable.
  6. Step 06

    Decimal is for fractional or measured numbers, such as a ratio or a calculated result. Its value field accepts the numeric forms shown by the editor. Keep a Decimal result as Decimal when later commands require that type.

    SetVariable: Overview step 6: Decimal is for fractional or measured numbers, such as a ratio or a calculated result. Its value field accepts the numeric forms shown by the editor. Keep a Decimal result as Decimal when later commands require that type.
  7. Step 07

    Boolean stores True or False. Use it for a flag, such as whether a condition was met, then test it in later logic. It is different from a String containing the words True or False.

    SetVariable: Overview step 7: Boolean stores True or False. Use it for a flag, such as whether a condition was met, then test it in later logic. It is different from a String containing the words True or False.
  8. Step 08

    Hex is for hexadecimal values, commonly used for colors. Enter a supported six-digit color value when that is what your next command expects. Hex is a distinct type, not ordinary text or a decimal count.

    SetVariable: Overview step 8: Hex is for hexadecimal values, commonly used for colors. Enter a supported six-digit color value when that is what your next command expects. Hex is a distinct type, not ordinary text or a decimal count.
  9. Step 09

    String stores text for later typing, prompts, comparisons, or text processing. In Single mode, Set from clipboard can use the clipboard instead of manual text and requires consent. We leave it off here and do not read or display any clipboard contents.

    SetVariable: Overview step 9: String stores text for later typing, prompts, comparisons, or text processing. In Single mode, Set from clipboard can use the clipboard instead of manual text and requires consent. We leave it off here and do not read or display any clipboard contents.
  10. Step 10

    Switch Single to Array for a typed collection of numbered entries. Enter an array letter, not a numbered entry, and set Capacity from one to four thousand ninety-six, or use an earlier Integer variable. Ordinary Array mode declares the collection; the Time Generator modes can initialize every entry from one source.

    SetVariable: Overview step 10: Switch Single to Array for a typed collection of numbered entries. Enter an array letter, not a numbered entry, and set Capacity from one to four thousand ninety-six, or use an earlier Integer variable. Ordinary Array mode declares the collection; the Time Generator modes can initialize every entry from one source.
  11. Step 11

    Time is for clock values and supported dates that later Time-aware commands can use. The Literal option provides direct entry. Time Generator adds explicit format and source choices. Enable it to select AM/PM Format or Unix Format, and Set Manually or Current Time.

    SetVariable: Overview step 11: Time is for clock values and supported dates that later Time-aware commands can use. The Literal option provides direct entry. Time Generator adds explicit format and source choices. Enable it to select AM/PM Format or Unix Format, and Set Manually or Current Time.
  12. Step 12

    For manual AM/PM entry, Clock provides Hours, Minutes, Seconds, and AM or PM. Whole Time accepts a complete supported time literal, an optional date, or an earlier Time variable. These presentations retain separate editor drafts. The two Manual guides demonstrate the syntax and actual results.

    SetVariable: Overview step 12: For manual AM/PM entry, Clock provides Hours, Minutes, Seconds, and AM or PM. Whole Time accepts a complete supported time literal, an optional date, or an earlier Time variable. These presentations retain separate editor drafts. The two Manual guides demonstrate the syntax and actual results.
  13. Step 13

    Current Time samples the device time when playback reaches this command, not while you edit it. There is no manual value to enter. In Array mode, the sampled value initializes the entries. Use this source when the value should reflect the moment that step actually runs.

    SetVariable: Overview step 13: Current Time samples the device time when playback reaches this command, not while you edit it. There is no manual value to enter. In Array mode, the sampled value initializes the entries. Use this source when the value should reflect the moment that step actually runs.
  14. Step 14

    Unix Format produces a Decimal number of seconds since the Unix epoch, with milliseconds represented as the fractional part. It is not a Time variable and not a number of milliseconds. Choose a manual epoch value or Current Time. Separate Unix guides cover Single and Array examples.

    SetVariable: Overview step 14: Unix Format produces a Decimal number of seconds since the Unix epoch, with milliseconds represented as the fractional part. It is not a Time variable and not a number of milliseconds. Choose a manual epoch value or Current Time. Separate Unix guides cover Single and Array examples.
  15. Step 15

    Changing incompatible types or formats can clear fields that no longer apply. Complete the selected mode before playback. To finish this editor tour, return to a basic Integer Single, enter i1 and seven, keep This Script Only, and save. We are not running a separate demo in this overview.

    SetVariable: Overview step 15: Changing incompatible types or formats can clear fields that no longer apply. Complete the selected mode before playback. To finish this editor tour, return to a basic Integer Single, enter i1 and seven, keep This Script Only, and save. We are not running a separate demo in this overview.
  16. Step 16

    Choose the matching tab for the workflow you need: basic Single or Array, manual or current time, and AM/PM or Unix format. Those focused guides use real playback and visible confirmations to show what each option produces.

    SetVariable: Overview step 16: Choose the matching tab for the workflow you need: basic Single or Array, manual or current time, and AM/PM or Unix format. Those focused guides use real playback and visible confirmations to show what each option produces.