Variables to differentiate between highlighted file and other selected files?

Started by GrantRobertson, May 21, 2020, 01:36:48 AM

Previous topic - Next topic

GrantRobertson

Whenever you select multiple files there is always one file that is highlighted as the "current" or "most recently selected file." It is the one with the yellow border in addition to the frame color being dark brown (redish-brown?).

I want to create a command in the ExifTool Command Processor where I pass that "current" file into one part of the command, and then pass the list of "other selected files" into another part of the command. Unfortunately, I can only find variables for a single file (used when only processing a single selected file, or when processing one file at a time using the "Run once per file" mode of the ExifTool Command Processor) or for the entire list of selected files using the {files} variable (which, apparently, is only available in the ExifTool Command Processor).

Specifically, I am trying to write a command that copies a set of metadata tags from one file into a set of other selected files using the -tagsFromFile argument. This is possible when using ExifTool on the command line. But is apparently not possible within the  ExifTool Command Processor because the appropriate variables do not seem to be available.

Mario

The standard way in IMatch to copy data between one source file and multiple target files is explained in Copying Attributes and Metadata Between Files

There is no variable which specifically addresses a focused file in the active File window.
Variables are always processed in specific contexts, and these contexts have no knowledge about file windows.
The VarToy app processes variables always for the focused file in the active file window. It was written that way.

Tools like the Batch Processor, Import & Export modules and the ECP work with selections of files. They have no knowledge about where these files come from. They may come from a file window. Or a filter output. Or have been dragged from somewhere.

You can access the focused file, and the selected files, from IMatch apps or external programs via the endpoints provided by IMWS.
Use the @imatch.filewindow.active.focusedfile idlist to request data for the focused file in the active file window, and @imatch.filewindow.active.selection to request data for all selected files.

Since you want to control ExifTool anyway, I recommend writing a small PowerShell script or maybe a Python/VB/C#/Java/... app that fetches the selected and focused file data you need and then either runs ExifTool directly or via args files.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook