Create custom variable.

Started by JobWellDone, July 11, 2022, 05:13:15 AM

Previous topic - Next topic

JobWellDone

I have folder with files and third party image viewer (XnView) that runs ExifTool exe with parameters.

I browse to folder with files:

\One.jpg
\Two.jpg
\Three.jpg

I select "One.jpg" and "Two.jpg" and run bath script and i want to create folder with name of first file selected ("One") and move both selected files in it.

So i get this:

\One\One.jpg
\One\Two.jpg
\Three.jpg

So far i use this code -k -Filename<${Directory}\${FileName;s/\.[^.]*$//}\${Filename} but it creates separate folders for each file selected.

Of course i can use static name for folder,

-k -Filename<${Directory}\MyCustomFolder\${Filename}

however then i would have to rename it manually after each move.

Phil Harvey

ExifTool processes one file at a time, so you would need to generate your own static name for the directory because what you have done will generate a different directory name for each file.

btw,

-Filename<${Directory}\${FileName;s/\.[^.]*$//}\${Filename}

is much more easily done like this:

-filename=%d%f/%f.%e

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