ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: gmac on June 06, 2023, 08:04:56 AM

Title: How to copy a tag to a field in a structure
Post by: gmac on June 06, 2023, 08:04:56 AM
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?
Title: Re: How to copy a tag to a field in a structure
Post by: Phil Harvey on June 06, 2023, 12:26:15 PM
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 (https://exiftool.org/mistakes.html#M5).

- Phil
Title: Re: How to copy a tag to a field in a structure
Post by: gmac on June 06, 2023, 02:00:29 PM
Thank you, will check it out.