Are Automator variables persistent?

為{幸葍}努か 提交于 2019-12-11 08:16:27

问题


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?


回答1:


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).




回答2:


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.



来源:https://stackoverflow.com/questions/3048165/are-automator-variables-persistent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!