KeyRoutines
StepFreevar.set

Set a variable in your routine to use in later steps

Set variable puts a value under a name so later steps can use it. By default it lasts for this run only, which makes it the usual way to keep a counter, a file path or a result to use further down.

How it works

  • Give it a name, such as count, and a value, which can include results from earlier steps.
  • The default scope is this run only; the advanced scope can save it for this routine or for every routine instead, like Remember does.
  • It returns the value it set.
  • Leaving the name empty fails the step.

Routines that use it

Loop counter

Inside a Repeat, raise a count with Calculate and Set variable, then stop repeating at ten.

Keep a path handy

Store a folder path once and use it in List files, Move or copy file and Zip files.

Hold an answer

Save the reply from Ask for input and use it in Type text later.

Settings

SettingWhat it does
NameThe variable's name ("count" or "vars.count").

Questions

How do I use variables in KeyRoutines?
Add Set variable with a name and value, then pick that variable in later steps' settings. It lasts for the current run unless you change the scope.
Can a variable keep its value after the routine ends?
Yes, switch the scope to routine or global. Remember does the same in a simpler form.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.