Add variables to an action in Automator on Mac
You can add a variable to a compatible field or pop-up menu of an action. The value of the variable is evaluated and used by the action when the workflow runs.
Click Variables in the top-left corner of the Automator window, then select a category from the Library.
The variables related to that category are displayed.
Drag the variable you want to use onto the field or pop-up menu of an action.
A green plus sign (+) appears if the variable is compatible.
When you use a variable in a text field, the variable may be used in-line with other text. When the workflow runs, the variable is evaluated and the value of the variable appears as a part of the text in the field.