How to run ExifTool script on the current directory?

Discuss and share scripts and script files...
Post Reply
wwcanoer
Posts: 9
Joined: 06 May 2013 20:25

How to run ExifTool script on the current directory?

Post by wwcanoer »

How to run a single line ExifTool script on the current directory?

For testing, I tried to display:
exiftool -if $DateTimeOriginal -DateTimeOriginal *.*

My actual command is: [to create the date from a filename ex. IMG-20190509-WA0009.jpg (but breaks over WA0060) ]
exiftool -P -overwrite_original "-datetimeoriginal<filename" *.*

They work in the address line by prefixing with ! but I would prefer a script assigned to a keypress as I will create more than one script.

I tried run "exiftool.exe ...." but no matter where I try adding quotation marks in singles, pairs or triplets there is always a "Dubious Syntax" error.
Adding the path to exiftool.exe didn't help.

Do I need to call the command/terminal window first? (I tried following another example but that failed as well.)

Can use the <curpath>? ex. exiftool -P -overwrite_original "-datetimeoriginal<filename" <curpath>

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

Re: How to run ExifTool script on the current directory?

Post by highend »

You can't execute commands directly in a script.

You need to use e.g. run or runret()

Like:

Code: Select all

    $result = runret("""exiftool"" -P -overwrite_original ""-datetimeoriginal<filename"" *.*");
    text $result;
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

wwcanoer
Posts: 9
Joined: 06 May 2013 20:25

Re: How to run ExifTool script on the current directory?

Post by wwcanoer »

That works. Thank you for the prompt reply!

My notes:

Works but the cmd window opens and automatically closes when done:

Code: Select all

run """exiftool""  -time:all -g1 -a -s *.mp4"  
The results open in a persistent window:

Code: Select all

$result = runret("""exiftool""  -time:all -g1 -a -s *.mp4");
text $result;

Post Reply