【发布时间】:2012-08-02 09:25:32
【问题描述】:
我正在使用应用程序自动化文件来接收一个设置为变量file 的文件,然后使用请求文本设置一个名为name 的变量。
我需要在两个地方使用它:
- shell 脚本
- 在咆哮通知中
我尝试了很多组合,但我都无法让变量在其中发挥作用。正确的语法是什么?
【问题讨论】:
标签: macos terminal applescript automator growl
我正在使用应用程序自动化文件来接收一个设置为变量file 的文件,然后使用请求文本设置一个名为name 的变量。
我需要在两个地方使用它:
我尝试了很多组合,但我都无法让变量在其中发挥作用。正确的语法是什么?
【问题讨论】:
标签: macos terminal applescript automator growl
尝试将其添加到您的自动化工作流程中:
on run {input, parameters}
-- Get name from automator
tell application "Finder" to set theName to name of file input
-- pass name into shell script and get variable back
set xxx to do shell script "echo " & theName
display dialog xxx
end run
【讨论】:
您不需要键入任何脚本。如果你转到 Growl 应用程序,右键单击,显示内容,Contents--->Library--> Automator
双击该文件,Automator 将添加咆哮动作。 享受;)
【讨论】: