Assign a value to a variable from several sources in RunMacro
Desktop ModeBrowser ModeRunMacro RunnerRunMacro 3.5+
The Assign Variable command sets a new value for a variable, taken from one of three sources: typed text, the clipboard, or another variable.
Dialog & quick setup

- Add a Variables › Assign Variable command.
- Choose the target variable.
- Choose the source: Text / Clipboard / Another variable, then enter the source value.
- Save.
Options reference
Modes & when to use
Desktop Mode
Browser Mode
Runs in the background through Chrome CDP: when the source is the clipboard, the command reads RunMacro’s virtual clipboard instead of the system clipboard.
RunMacro Runner
Best for
- Update a variable with freshly copied content (clipboard).
- Copy a value from one variable to another.
- Reset a variable with new text.
Use an alternative when
- Do not use it for calculations, regex, or explicit Global/Dynamic declaration.
Before you run
- Add Assign Variable to the macro.
- Prepare the data or target that Assign Variable will use.
Example workflow
Example: save copied content into a variable
- Copy Text some content on screen.
- Assign Variable
result, source Clipboard. - Use
{result}in a later step.
Expected result: After execution, Assign Variable completes the described action and makes its result available to the next step.
Tips & limitations
To create a new variable with a type, use Declare Variable; Assign Variable updates a value.
- Clipboard source depends on desktop/virtual context; a missing source variable can produce empty or unexpected output.
Applies to RunMacro 3.5+ · Desktop Mode & Browser Mode & RunMacro Runner · Windows 10/11
