我已经搜索了我的*,但找不到任何对我有意义的东西。
我想在 Finder 中选择 jpgs 并使用上下文菜单中的服务选项将关键字附加到图像。我使用 Automator 询问关键字并将其存储在变量中。
接下来是使用带有 exiftool 的 shell 脚本来附加关键字。
问题是编写一个与这两个变量一起使用的 shell 脚本(其中一个当然是包含文件名的数组)
我发现了一篇非常有趣的博客文章: http ://coreygilmore.com/blog/2010/05/07/passing-multiple-automator-variables-to-a-shell-script/
但我发现 Shell 代码太混乱了,无法做到这一点:
对于每个文件
exiftool IPTC:Keywords+="$MyKeywordsString" $file
请帮我!我猜 Applescript 也可以,但我也不知道怎么写……</p>
提前致谢!
@shellter:没用,这是我的终端输出:
Last login: Thu Jul 28 19:57:54 on ttys000
localhost:~ benjamin$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
localhost:~ benjamin$ export Keywords=testKeyword
localhost:~ benjamin$ echo $Keywords
testKeyword
localhost:~ benjamin$ /Users/benjamin/Desktop/myKeyWords.sh /Users/benjamin/Desktop/image.jpg /Users/benjamin/Desktop/image2.jpg
/Users/benjamin/Desktop/myKeyWords.sh: line 1: $: command not found
File not found: Keywords=
======== /Users/benjamin/Desktop/image.jpg
ExifTool Version Number : 8.61
File Name : image.jpg
Directory : /Users/benjamin/Desktop
File Size : 128 kB
File Modification Date/Time : 2011:07:27 10:41:49+02:00
File Permissions : rw-r--r--
File Type : JPEG
MIME Type : image/jpeg
JFIF Version : 1.01
Resolution Unit : None
X Resolution : 1
Y Resolution : 1
Current IPTC Digest : c76c591fd016b068e1b44202c9f1996c
Keywords : MeinNeuerTag, MeinNeuerTag
Application Record Version : 4
Comment : CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90.
XMP Toolkit : XMP Core 4.4.0
Image Width : 600
Image Height : 601
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 600x601
1 image files read
1 files could not be read
为什么它将关键字视为文件?我必须将脚本放在哪里才能输入“脚本参数参数”而不是路径?抱歉,我对输入“echo $PATH”时终端回显的内容一无所知,也许您可以帮助我。
再次感谢你!非常感激!