【问题标题】:using an output from AppleScript as input to a Shell Script in Automator使用 AppleScript 的输出作为 Automator 中 Shell 脚本的输入
【发布时间】:2015-06-26 13:27:04
【问题描述】:

我正在使用 Apple Automator,在我的工作流程中,我有一个“运行 AppleScript”。我想向用户展示一个项目列表:

on run
    choose from list {"DRNyheder", "DR1", "DRVejret", "ditbt", "ekstrabladet"} with prompt "Please make your selection" without multiple selections allowed and empty selection allowed
    set aName to item 1 of the result
    display dialog aName
    return aName
end run

管道中的下一项是“运行 Shell 脚本”。在这种情况下,它是一个 python 脚本。我的想法是我想将 AppleScript 的输出提供为 argv 1。我已经验证 AppleScript 正在返回一个字符串,就像我期望的那样。

/Users/fred/my_script.py $@

问题是,我没有看到参数被传递给我的 Python 脚本。有人可以帮忙吗?

如果有帮助,这里是这部分工作流程的屏幕截图:

【问题讨论】:

    标签: python bash sh osx-yosemite automator


    【解决方案1】:

    好的,这很容易令人尴尬。事实证明,Shell 脚本窗口的右上角有一个设置,您可以在其中将输入“作为参数”传递。就是这张票。

    【讨论】:

      猜你喜欢
      • 2017-04-16
      • 1970-01-01
      • 2015-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-10
      相关资源
      最近更新 更多