Shortcuts for Windows Explorer 'Send To' right-click menu

Started by mcjtom, January 02, 2020, 12:13:32 AM

Previous topic - Next topic

Phil Harvey

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

mcjtom

I'm pushing my luck...

There is another Windows SendTo Shortcut script that extracts all preview/thumbnail images and places them in the same folder as the input file.  It works, but I would prefer to create subfolders for the extracted images.  No matter what I try, I'm getting an error...

"C:\Program Files\Digital Light & Color\Picture Window Pro 8\exiftool.exe" -a -b -W %d%f.%e_%t%-c.%s -progress -r -k -preview:all

StarGeek

The %d is the directory of the file being proccessed, including trailing slash.  The %f is the name of the file without the extension.  Put the name of your subfolder between them.
%dSubfolder/%f
* 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).


mcjtom

Hmm... Another porblem that I'm too ignorant to solve.  Here is the SendTo Shortcut script that I believe reads OS file creation date and sticks its year into the EXIF:Copyright tag. 

%PWP%\exiftool.exe -EXIF:Artist="Maciej Tomczak" -d %Y "-EXIF:Copyright<Copyright (c) $FileCreateDate Maciej Tomczak / www.phototramp.com / Unlicensed use prohibited." -P -r -overwrite_original -progress -k

I set Windows environment variable %PWP% that points to the folder where exiftool.exe is, to shorten the script.

While I'm royally confused about different file and metadata date and time stamps, where they are kept and what events can change them, I guessed that TimeDateOriginal would be the camera EXIF date stamp.  I decided against it and in favour of FileCreateDate as some images may be stripped of EXIF and the script will fail. 

I imagine the -if command could be used to check if TimeDateOriginal is there, but I don't know how to make -if to produce an alternative output (i.e. FileCreateDate) if the condition fails.

Perhaps there are some other date tricks that could be used to make my script better, but I need a EXIFTool Jedi for that...

Cheers!

mcjtom

While I still haven't solved my conditional copyright year dilemma, thanks to StarGeek I figured out a short way of writing copyright to EXIF, IPTC, and XMP in one go.  The -IPTC:Credit="..." is there to populate the IPTC as without it -MWG doesn't want to write there.

%PWP%\exiftool.exe -IPTC:Credit="Maciej Tomczak" -MWG:Creator="Maciej Tomczak" -d %Y "-MWG:Copyright<Copyright (c) $FileCreateDate Maciej Tomczak / www.phototramp.com / Unlicensed use prohibited." -P -r -overwrite_original -progress -k

Phil Harvey

Quote from: mcjtom on January 04, 2020, 05:35:53 AM
I imagine the -if command could be used to check if TimeDateOriginal is there, but I don't know how to make -if to produce an alternative output (i.e. FileCreateDate) if the condition fails.

You don't use -if for this.  Instead, do this:

%PWP%\exiftool.exe -EXIF:Artist="Maciej Tomczak" -d %Y "-EXIF:Copyright<Copyright (c) $FileCreateDate Maciej Tomczak / www.phototramp.com / Unlicensed use prohibited." "-EXIF:Copyright<Copyright (c) $DateTimeOriginal Maciej Tomczak / www.phototramp.com / Unlicensed use prohibited." -P -r -overwrite_original -progress -k

The second assignment will overwrite the first if DateTimeOriginal exists.

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

mcjtom

Great, thanks!

One more iteration: if I want to simplify the issue and just use DateTimeOriginal and, rather than looking for FileCreateDate, just skip the year in the copyright info if the EXIF date doesn't exist? 

The way I tried it before, no copyright tags are written if DateTimeOriginal is specified but missing.

Cheers!

mcjtom

I think I solved it with the -f option.  It prints "-" when the -DateTimeOriginal doesn't exist.  And the bonus is that my notice is still within 260 characters of Windows Shortcut Target limit, which simplifies things for me.

%PWP%\exiftool.exe -IPTC:Credit="Maciej Tomczak" -MWG:Creator="Maciej Tomczak" -f -d %Y "-MWG:Copyright<Copyright (c) $DateTimeOriginal Maciej Tomczak / www.phototramp.com / Unlicensed use prohibited." -P -r -overwrite_original -progress -k