【问题标题】:macOS automator - run shell script not workingmacOS automator - 运行 shell 脚本不起作用
【发布时间】:2021-04-24 04:16:13
【问题描述】:

所以我有一个输出格式为 2021-01-15 02:20:33 的 shell 脚本。它适用于命令行和 AppleScript,但不适用于 automator。不知道如何解决它,我已经进行了一些搜索,但没有任何结果可以解决 shell 脚本在 automator 中不输出值的问题。

适用于:

  • 终端

  • 小程序

在自动机中不起作用

  • 作为 shell 脚本:它运行但输出为空白。但是有输出。

  • 作为 Automator 上的 Applescript - 无输出

任何帮助将不胜感激

【问题讨论】:

  • 请将tm.sh的内容添加到您的问题中。另外,为什么不让tm.sh executable 然后直接execute 它而不必将其传递给sh
  • 内置/bin/date:set timeStamp to do shell script "/bin/date +%Y-%m-%d' '%H:%M:%S"有什么问题?而且你不需要多余的as string
  • 它实际上是从文件中提取嵌入的时间戳。
  • 不幸的是我无法发布 tm.sh 的实际内容
  • 我只是想了解我是否需要对 automator 做一些我不必对 shell 和 AppleScript 做的事情来获得相同的预期结果?

标签: macos shell applescript automator


【解决方案1】:

问题是 automator 在隐私方面没有完整的磁盘访问权限。启用后,脚本按预期工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-09-29
    • 2020-05-24
    • 2016-02-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多