【发布时间】:2020-06-25 20:56:42
【问题描述】:
我在 MacOS Catalina 10.15.3 上
我正在使用 zsh
我想创建一个 Atomator 应用程序,它可以为我从文件中删除元数据。 Atomator 应用程序的工作方式是,我将文件拖放到应用程序上,应用程序启动一个 shellscript,文件路径作为输入。
我正在使用 exiftools 删除元数据。
我首先测试了如果我在终端中使用 exiftools 是否有效:
而且有效。
但是当我在我的 Automator 应用程序的 shellscript 中使用 exiftool 时,它会说,它没有找到命令“exiftools”。
这是我的 Automator 工作流程:
自动化运行这个 Shellscript:
for f in "$@"
do
echo "$f"
done
xattr -c "$f"
exiftool -all= "$f"
rm -r "$f"_original
我测试了一下,文件路径正确存储在$f变量中。
但由于某种原因,Automation 中的 shellscript 不能使用 exiftool。
并且错误信息中的第二个错误并不重要,因为它出现是因为exiftool命令没有运行。
这是自动化应用程序的错误消息:
------------
非常感谢
【问题讨论】:
-
我对 macos 和 automator 不太了解 - 请参阅控制台和 automator 中的
echo "$PATH"输出。或者:找出exiftool和whereis exfitool的位置并将/full/path/to/exfitool放入您的脚本中。 -
谢谢, :D 当我发现它在哪里时,我如何将它放在我的脚本中?像这样:#!/full/path/to/exiftools ?或像这样。 /full/path/to/exiftools -all= "$PATH" ?
-
只需将
exiftools替换为/usr/bin/exiftools或类似名称。前任。从您的终端尝试一下。 -
好的,谢谢,我试试看
-
我解决了这个问题,我的应用程序现在可以运行了。我将 exiftools 移动到一个名为 Tools 的文件夹中,然后让 shellscript 移动到该文件夹并使用 .exiftol 执行 exiftol。 /