How to copy a tag to a field in a structure

Started by gmac, June 06, 2023, 08:04:56 AM

Previous topic - Next topic

gmac

I'm using the xmpMM tags and specifically the ResourceEvent structure. I write the tag like this:
exiftool -XMP-xmpMM:History+="[{ \
      Action='Initial write of custom metadata', \
      InstanceID<OriginalDocumentID, \
      Parameters=none, \
      SoftwareAgent=exiftool invoked by script, \
      When=$today }]"


As you will see, I'm trying to copy the tag OriginalDocumentID to the InstanceID field in the structure. This gives a warning "Invalid structure field at InstanceID".

What is the correct way to do this, please?

Phil Harvey

I had problems trying to use backslash to continue the command within the quotes, but this worked for me (provided "$today" is a valid EXIF date/time format):

exiftool '-XMP-xmpMM:History+<[{ Action=Initial write of custom metadata, InstanceID=$OriginalDocumentID, Parameters=none, SoftwareAgent=exiftool invoked by script, When='"$today }]"

You main problem was common mistake 5c.

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

gmac