2011-11-12 36 views
0

我有一个automator工作流程。如何使其在if语句中重新启动工作流?automator applescript重启工作流程

on run {input, parameters} 

if (input as text) is "" then 
    -- restart workflow 
end if 

return input 
end run 
+0

'if'之前/之后的任何命令? – wannik

+0

@wannik在if之前/之后没有命令。 – gadgetmo

回答

0

没有AppleScript的

在Automator的工作流程结束后,把Loop。 (LoopLibrary > UtilitiesLoop有一个选项Ask to Continue。如果用户点击Continue,Automator将重启工作流程。如果不是,将执行Loop之后的下一个进程。

使用AppleScript

在Automator的工作流程结束后,把Run AppleScriptLoop。将Loop选项设置为Loop automaticallyStop Aftertimes。 AppleScript代码如下。

on run {input, parameters} 
    if (input as text) is "" then 
     tell me to quit 
    end if 
    return input 
end run 

后面的选择可以重复不超过1000次。

相关问题