从automator中的脚本路径更改运行

问题描述 投票:0回答:1

首先,我的OSX是10.14.4并且我在OSX中内置了bash v3,最近我通过brew更新了bash v5。我确实改变了默认的chsh -s /usr/local/Cellar/bash/5.0.3/bin/bash一切正常,除了一些利用“从脚本运行”的苹果工作流程/脚本

当我尝试在automator中从v3切换到v5时,没有任何选项。 enter image description here

所以我的问题是,是否有人知道如何向automator添加新的bash选项?

谢谢

bash macos applescript automator
1个回答
0
投票

你必须编辑你的Shells.plist文件,可以在以下位置找到:

/System/Library/Automator/Run\ Shell\ Script.action/Contents/Resources/Shells.plist

添加以下这些行:

<key>/usr/local/Cellar/bash/5.0.3/bin/bash</key>
<dict>
    <key>args</key>
    <array>
        <string>-c</string>
        <string>%</string>
        <string>-</string>
    </array>
    <key>script</key>
    <array>
        <string>cat</string>
        <string>for f in "$@"&#10;do&#10;&#09;echo "$f"&#10;done</string>
    </array>
</dict>

© www.soinside.com 2019 - 2024. All rights reserved.