Author Topic: Trouble with command syntax when copying tags  (Read 1137 times)

3design

  • Jr. Member
  • **
  • Posts: 29
Trouble with command syntax when copying tags
« on: December 06, 2014, 01:10:07 PM »
I'm trying to copy a specific set of tags from a list of source images to a list of destination images in Win7. I've used regex to create a batch file to run the entire sequence, but am getting an error when it runs. This is a sample line from the batch file:

Code: [Select]
exiftool -P -tagsfromfile "E:\src.tif" 'EXIF:Artist>EXIF:Artist' 'EXIF:ImageDescription>EXIF:ImageDescription' 'IPTC:Caption-Abstract>IPTC:Caption-Abstract' 'IPTC:CodedCharacterSet>IPTC:CodedCharacterSet' 'IPTC:CopyrightNotice>IPTC:CopyrightNotice' 'IPTC:Headline>IPTC:Headline' 'IPTC:Keywords>IPTC:Keywords' 'IPTC:ObjectName>IPTC:ObjectName' 'IPTC:Prefs>IPTC:Prefs' 'IPTC:SpecialInstructions>IPTC:SpecialInstructions' 'XMP:CaptionWriter>XMP:CaptionWriter' 'XMP:Creator>XMP:Creator' 'XMP:CreatorWorkEmail>XMP:CreatorWorkEmail' 'XMP:CreatorWorkURL>XMP:CreatorWorkURL' 'XMP:Credit>XMP:Credit' 'XMP:Description>XMP:Description' 'XMP:EditStatus>XMP:EditStatus' 'XMP:Headline>XMP:Headline' 'XMP:Instructions>XMP:Instructions' 'XMP:Marked>XMP:Marked' 'XMP:Prefs>XMP:Prefs' 'XMP:Rating>XMP:Rating' 'XMP:Rights>XMP:Rights' 'XMP:Source>XMP:Source' 'XMP:Subject>XMP:Subject' 'XMP:Title>XMP:Title' 'XMP:UsageTerms>XMP:UsageTerms' 'XMP:WebStatement>XMP:WebStatement' "E:\dest.tif"
When it runs, it gives me the following error:

Error: File not found - 'EXIF:Artist
Error: File not found - 'EXIF:ImageDescription
Error: File not found - 'IPTC:Caption-Abstract
and so on.. listing each of the tags in my batch. I'm not sure what specific portion of my command line is faulty...

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2668
Re: Trouble with command syntax when copying tags
« Reply #1 on: December 06, 2014, 02:05:10 PM »
You are using single quotes where you need to use double quotes on windows.  You're also missing the minus sign at the beginning of the tags.  So, instead of 'EXIF:Artist>EXIF:Artist', you should be using "-EXIF:Artist>EXIF:Artist"

Also, not something wrong, but it looks like most, if not all, of those tags you can just use the name, you don't need to specifically redirect them.  Instead of "-EXIF:Artist>EXIF:Artist" you could use -EXIF:Artist or even just -Artist. This command should do just as well for you. 
Code: [Select]
exiftool -P -tagsfromfile "E:\src.tif" -Artist -ImageDescription -Caption-Abstract -CodedCharacterSet -CopyrightNotice -IPTC:Headline -Keywords -ObjectName -IPTC:Prefs -SpecialInstructions -CaptionWriter -Creator -CreatorWorkEmail -CreatorWorkURL -Credit -Description -EditStatus -XMP:Headline -Instructions -Marked -XMP:Prefs -Rating -Rights -Source -Subject -Title -UsageTerms -WebStatement "E:\dest.tif"
The only cases I saw in that command where you would want to explicitly say where the tags go were the Prefs and Headline tags, since they would both only go into IPTC (preferred location) unless there already was an XMP group in the destination file.   
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.