Apple shell for adding keywords to JPGs? AppleScript doesn't like equal sign

Started by ericconn, September 04, 2013, 11:29:55 AM

Previous topic - Next topic

ericconn

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.

Phil Harvey

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 for details.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ericconn

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.

ryerman

Windows 10 Home 64 bit, Exiftool v12.61

Phil Harvey

Nice trick ryerman (the citebite).  I'll have to remember this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ericconn