I'm having a lot of trouble getting some code to work properly. I need to take provided image files and move into a new directory based on three criteria:
- predefined path: ~/Desktop/Output/_Complete/
- Followed by a directory named as the data in the -creatoraddress tag
- Followed by a directory named as first fifteen digits of the file name = %15f
For example, a file named BLYMP3001712172_01.jpg has a -creatoraddress of "17-01-09 Accessories PM1 B1 ericgeving W" and I want to move it into a new directory with the following path:
~/Desktop/Output/_Complete/17-01-09 Accessories PM1 B1 ericgeving W/BLYMP3001712172/
I've been trying many different variations and just get errors or directories named as the tag name. Example of what I have tried:
exiftool -o ~/Desktop/Output/_Complete/-creatoraddress/%15f -FileName=%15f%+.2nc.%e
This results in the file being
copied into a directory called "-creatoraddress" and no sub-directory for filename
exiftool -directory=/Users/seanmurp/Desktop/Output/_Complete/-creatoraddress/%15f -FileName=%15f%+.2nc.%e
This results in the file being
moved into a directory called "-creatoraddress" but there is a sub-directory with filename(15 character) as expected.
exiftool -directory=/Users/seanmurp/Desktop/Output/_Complete/$creatoraddress/%15f -FileName=%15f%+.2nc.%e
This results in the file being
moved into a directory called filename(15 character)
exiftool ~/Desktop/Output/_Complete/ "-directory<creatoraddress" -FileName=%15f%+.2nc.%e
This results in the file being
moved into a directory named with the creatoraddress but at the user level not within ~/Desktop/Output/_Complete/
I'm sure this is probably some simple issue but help would be greatly appreciated.
See Common Mistakes #5 (http://www.exiftool.org/mistakes.html#M5) for some insights.
The equal sign assigns a constant value to a tag. To copy the contents of a tag, you want to use the Greater/Less than sign. Also, you don't want to have a leading dash in the source tag. If you want to change Directory and Filename, you can include the directory path in the value you assign to Filename.
Try:
exiftool "-Filename</Users/seanmurp/Desktop/Output/_Complete/$creatoraddress/%15f%+.2nc.%e"