【问题标题】:Mac automator: use variables in shell & growl notificationMac automator:在 shell 和咆哮通知中使用变量
【发布时间】:2012-08-02 09:25:32
【问题描述】:

我正在使用应用程序自动化文件来接收一个设置为变量file 的文件,然后使用请求文本设置一个名为name 的变量。

我需要在两个地方使用它:

  1. shell 脚本
  2. 在咆哮通知中

我尝试了很多组合,但我都无法让变量在其中发挥作用。正确的语法是什么?

【问题讨论】:

    标签: macos terminal applescript automator growl


    【解决方案1】:

    尝试将其添加到您的自动化工作流程中:

    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
    

    【讨论】:

      【解决方案2】:

      您不需要键入任何脚本。如果你转到 Growl 应用程序,右键单击,显示内容,Contents--->Library--> Automator

      双击该文件,Automator 将添加咆哮动作。 享受;)

      【讨论】:

      • 谢谢,但你不能那样使用变量
      猜你喜欢
      • 2011-09-26
      • 1970-01-01
      • 2010-10-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-02
      • 1970-01-01
      相关资源
      最近更新 更多