ExifTool Forum

ExifTool => Developers => Topic started by: ericconn on September 04, 2013, 11:29:55 AM

Title: Apple shell for adding keywords to JPGs? AppleScript doesn't like equal sign
Post by: ericconn on September 04, 2013, 11:29:55 AM
I have lots of duplicate JPGs to deal with, and the one way I did so was using a Windows BAT file to add keywords scanned from duplicates to a master image, using the command  >exiftool -Keywords+="keyword1" -Keywords+="keyword2" -overwrite_original "C:\directory\image.jpg"<. However, permissions have changed and I can't do it on Windows anymore, but have access to Mac.

I can copy and paste into Mac Terminal, but If I paste too many commands at a time into it, things get weird, and the originals don't get overwritten, as if the program. I COULD hand copy and paste a few lines at a time, but I'm dealing with lots and lots of duplicates. I also can't make an AppleScript for this command because it doesn't like the = equal sign in the command.

Is there an Apple shell that could help me accomplish this? Any thoughts? Thanks a lot.
Title: Re: Apple shell for adding keywords to JPGs? AppleScript doesn't like equal sign
Post by: Phil Harvey on September 04, 2013, 11:42:26 AM
Or you could take advantage of the ExifTool -@ option and run all of your commands from a single argfile (with -execute options between commands). See the application documentation (https://exiftool.org/exiftool_pod.html) for details.

- Phil
Title: Re: Apple shell for adding keywords to JPGs? AppleScript doesn't like equal sign
Post by: ericconn on September 04, 2013, 03:46:05 PM
Thanks for the suggestion. I tried to test this and didn't have luck. I made a file called "argfile" in a folder "test", with the code

exiftool -Keywords+="test argument" -overwrite_original "/Volumes/Macintosh_HD/test/test.jpg"
-execute
exiftool -Keywords+="test argument2" -overwrite_original "/Volumes/Macintosh_HD/test/test2.jpg"
-execute


and then put into Terminal

exiftool -@ /Volumes/Macintosh_HD/test/argfile

and I get back

File not found: exiftool -Keywords+="test argument" -overwrite_original "/Volumes/Macintosh_HD/test/test.jpg"
File not found: exiftool -Keywords+="test argument2" -overwrite_original "/Volumes/Macintosh_HD/test/test2.jpg"


I tried two other drives with the same folder/files, and no luck there either. Am I missing something? Thanks again for the help.
Title: Re: Apple shell for adding keywords to JPGs? AppleScript doesn't like equal sign
Post by: ryerman on September 04, 2013, 08:48:15 PM
http://pages.citebite.com/q2o0j5y0g1mya
Title: Re: Apple shell for adding keywords to JPGs? AppleScript doesn't like equal sign
Post by: Phil Harvey on September 05, 2013, 07:06:17 AM
Nice trick ryerman (the citebite).  I'll have to remember this.

- Phil
Title: Re: Apple shell for adding keywords to JPGs? AppleScript doesn't like equal sign
Post by: ericconn on September 09, 2013, 09:50:02 AM
My issue was the quotes. I got it to work. Thanks for the help.