是否可以在automator工作流中存储持久化值(特别针对服务流)?
似乎常规的automator变量are not persistent;例如,尝试使用an applescript chunk which has a property (通常会持续)实际上也不会持久化Applescript中的属性(在测试中有效,但当您运行服务时,该值不会持久化)。
有什么想法吗?
发布于 2012-11-11 13:22:45
您可以使用脚本对象将数据存储在一个偏僻的地方。

on run
-- Path of script which holds data
set thePath to (path to desktop as text) & "myData.scpt"
--set thePath to (path to preferences as text) & "myData.scpt" -- better
script theData
property xxx : missing value
end script
try
set theData to load script file thePath
on error
-- On first run, set the initial value of the variable
set theData's xxx to 5
end try
-- change the value of the variable
set theData's xxx to (theData's xxx) + 1
-- save your changes
store script theData in file thePath replacing yes
return theData's xxx
end runhttps://stackoverflow.com/questions/13325386
复制相似问题