Docs
RunMacro Documentation
Create your first robot, then go further as needed.
Clear step-by-step guides to create, run, and improve robots for repetitive computer work.
Assign a value to a variable from several sources in RunMacro
The Assign Variable command sets a new value for a variable, taken from one of three sources: typed text, the clipboard, or another variable.
Prerequisites#
- Add Assign Variable to the macro.
- Prepare the data or target that Assign Variable will use.
Supported modes#
- 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
What it does#
The Assign Variable command sets a new value for a variable, taken from one of three sources: typed text, the clipboard, or another variable.
Screenshots & video#

When to use it#
- Update a variable with freshly copied content (clipboard).
- Copy a value from one variable to another.
- Reset a variable with new text.
When not to use it#
- Do not use it for calculations, regex, or explicit Global/Dynamic declaration.
Configuration steps#
- Add a Variables › Assign Variable command.
- Choose the target variable.
- Choose the source: Text / Clipboard / Another variable, then enter the source value.
- Save.
Every option explained#
Expected result#
After execution, Assign Variable completes the described action and makes its result available to the next step.
Real example#
Example: save copied content into a variable#
- Copy Text some content on screen.
- Assign Variable
result, source Clipboard. - Use
{result}in a later step.
Limitations and failure cases#
- Clipboard source depends on desktop/virtual context; a missing source variable can produce empty or unexpected output.
Tips & common mistakes#
To create a new variable with a type, use Declare Variable; Assign Variable updates a value.
Verification details#
commands/variables.py
