Get current contents of Tag while using WriteAlso

Started by StarGeek, January 13, 2019, 05:11:14 PM

Previous topic - Next topic

StarGeek

Is it possible to get the current contents of a tag while doing a WriteAlso in a user defined tag?

For example, if I want to write to HierarchicalSubject based upon what values are already in that tag, is it possible to access the current contents of HierarchicalSubject, do some operations, and then pass the new values back to the WriteAlso routine?

The end goal is to create a tag in which I can pass a keyword to the user defined tag (e.g. "John Smith"), which would then check to see if any HierarchicalSubject elements have that keyword ("Friend|John Smith", "Family|John Smith") and then pass all the matches back to WriteAlso.  While this wouldn't be useful for adding tags, it would help with removing tags.  So -MyTag-="John Smith" could be used to remove both "Friend|John Smith", and "Family|John Smith".

Just an idea I had and certainly not worth trying to add the ability to exiftool if it's not currently possible.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

No, this isn't possible.  The WriteAlso values are determined before the first file is processed, so they can't be set dynamically like this.  The only way to do something with the existing value would be like this:

"-mycompositetag<HierarchicalSubject"

In this case, new new value in the WriteAlso expression ($val) is the existing value of HierarchicalSubject.

- 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 ($).