avpaderno
avpaderno

Reputation: 29748

Are Automator variables persistent?

Do Automator variable persist between executions of a workflow? If a variable is set during the execution of a workflow, can I get the last value assigned to a variable, once the workflow is executed again?

Upvotes: 2

Views: 589

Answers (2)

avpaderno
avpaderno

Reputation: 29748

Automator variables are not persistent. I created a test service from a workflow that outputs the content of a variable, and then sets the variable content to the text selected in the host application; the invocation of the service always returned an error about the variable, which means the variable content was not persistent (differently, the error would have been reported only the first time).

Upvotes: 3

regulus6633
regulus6633

Reputation: 19040

I don't use automator so I'm not sure. However, I know that if you're using applescript then you can have persistent variables by defining them as a property. So instead of using (set myVar to "something") you'd use (property myVar : "something"). Maybe you can do something like that in your automator code. Other than applescript code, you'd probably have to manually write your values to a file and read them back to restore them.

Upvotes: -2

Related Questions