【问题标题】:Shell script in Automator is not workingAutomator 中的 Shell 脚本不起作用
【发布时间】:2014-12-18 15:13:58
【问题描述】:

感谢this post,我刚刚弄清楚了如何在 Automator 中将变量传递给 shell 脚本,但现在脚本无法正常工作,而在终端中运行良好。我错过了什么?尝试使用和不使用引号。顺便说一句,该脚本用于将音频转换为任何格式,在本例中为 m4r 铃声格式。

afconvert [original-audio-file] [ringtone-file] -f m4af

这是自动化工作流程的屏幕截图

【问题讨论】:

    标签: macos shell automator


    【解决方案1】:

    您可能需要告诉 shell 脚本 afconvert 的安装位置。因此,在终端中输入:

    which afconvert
    

    找到它在哪里。然后使用它在脚本中显示的完整路径,如下所示:

    /usr/local/bin/afconvert "$1" "$2" -f m4af
    echo $1
    echo $2
    

    【讨论】:

      最近更新 更多