ExifTool > The "exiftool" Application

User-defined variable

(1/1)

gheppell:
Hello. 

Please pardon this simple question, but I am wondering if I can define a simple custom variable that holds a string.

For context, I sometimes run a command that adds timezone info to some xmp tags.  If goes something like this.

exiftool -datecreated<${createdate}-07:00 -datetimeoriginal<${createdate}-07:00

There are actually 3 or 4 of these, so when I change the timezone info, I have to alter each part of the command individually.  I would like to set the first 3 characters of the time zone as a custom variable then have the commands reference it.  Something like

exiftool -mycustomstring="-06" -datecreated<${createdate}${mycustomstring}:00 -datetimeoriginal<${createdate}${mycustomstring}:00....etc for the other 3 or 4 of these that I do at once. 

Thank you

StarGeek:
I'd suggest adding a shortcut to your .ExifTool_config file. 

For your example tags, your shortcut would be something like
   MyXMPDates   => ['XMP:DateCreated','XMP:DateTimeOriginal'],

You would add this to the shortcut section of your config file.  If you don't already have a shortcut section, the entire thing would be
%Image::ExifTool::UserDefined::Shortcuts = (
   MyXMPDates   => ['XMP:DateCreated','XMP:DateTimeOriginal'],
);

Then your command to write to all the tags at once would be
exiftool "-MyXMPDates<${createdate}-07:00" /path/to/files/

See the example.config file for further details

Navigation

[0] Message Index

Go to full version