"No File Specified" for 1st part of ARG file process

Started by filmgeezer, January 07, 2020, 12:00:07 PM

Previous topic - Next topic

filmgeezer

I'm sure I'm doing something really stupid, but darned if I can figure out what it is.

The goal here is to:
1) Put Date-Time-Original into the GPS time spots (in both XMP and JPGs) if those GPS times don't exist.
2) Copy all other XMP data into JPGs.

The reason is that when I use Lightroom to put data on raw/jpg stacks, most of that data resides in the XMP sidecars alone, and, without proper GPS times (and other info) in the Jpegs, when these are automatically uploaded to Google Photos, all heck breaks loose with timelines, etc.

I can get the above jobs done with separate ARG files. But when I combine them (and try to put -execute in between them), the first part doesn't run -- it says "No File Specified", then the second part runs.
I like to use these in Windows shortcuts so I can just drop folders on them. In this case, using the combined ARG file both from a shortcut as well as from command line results in the same behavior for the first portion.

First part:
-GPSTimeStamp<${DateTimeOriginal}-05:00
-GPSDateStamp<${DateTimeOriginal}-05:00
-XMP:GPSDateTime<${DateTimeOriginal}-05:00

# only do this if there's no GPS timestamp already
# this happens when GPS coords are applied in Lightroom

-if
(not$GPSTimeStamp)
-k
-r
-progress
--ext
arw
--ext
cr2
--ext
raf


Second part

# Now copy all tags from xmp to JPG
# This is necessary because Lightroom stores important metadata in the XMP and doesn't move it into the JPG,
# because it considers that a mere sidecar to the RAW file

-tagsfromfile
%d%f.xmp
-ext
jpg
-ext
jpeg
-r
-k
-progress


Combined, doesn't work for me:

-GPSTimeStamp<${DateTimeOriginal}-05:00
-GPSDateStamp<${DateTimeOriginal}-05:00
-XMP:GPSDateTime<${DateTimeOriginal}-05:00

# only do this if there's no GPS timestamp already
# this happens when GPS coords are applied in Lightroom

-if
(not$GPSTimeStamp)
-k
-r
-progress
--ext
arw
--ext
cr2
--ext
raf
-execute

# Now copy all tags from xmp to JPG
# This is necessary because Lightroom stores important metadata in the XMP and doesn't move it into the JPG,
# because it considers that a mere sidecar to the RAW file

-tagsfromfile
%d%f.xmp
-ext
jpg
-ext
jpeg
-r
-k
-progress

StarGeek

The thing to remember about the -execute option is that everything before it is the same as a separate command.  Since you don't have a file name included in the first part, exiftool issues the error that it can't find a file to process.

To break it down, your command is like this
exiftool <do something> -execute <do something else> FILE
Everything before the execute is like a separate command.  When you split it up, it's like these two separate commands
exiftool <do something>
exiftool<do something else> FILE
As you can see, there's no FILE to process in the first part.

What you need to add is the -Common_Args option
exiftool -@ MyArgFile.args -Common_Args /path/to/Files/

That way, anything after the -Common_Args will be added to both parts of your command.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

filmgeezer

That makes sense. Trying to figure out how to shortcuterize that is my next step, I guess.

Well, that was easy, just use -common_args at the end of the shortcut command, no files/dir specified, and it runs on the dropped folder/files.

So, with the combined ARG file, the shortcut Target looks like this:

"C:\Program Files (x86)\Exiftool\exiftool.exe" -@ mypath\myargfile -common_args