Fill Metadata Via Filename

Started by Darius1968, January 19, 2024, 05:52:43 PM

Previous topic - Next topic

Darius1968

Consider this as a filename, in which the hyphens are separators: 
reddit-john doe-cute persuasion.jpg

Upon ingestion into the database or running a metadata template (or similar), I'd like reddit to be automatically entered into the Copyright URL tag, john doe to be in the Person In Image, and cute persuasion to be in an attribute of my choosing.  How can I pull this off? 

Mario

The first part is easy to do using a Metadata Template, thanks to IMatch variables and functions, namely splitlist:Split char,Index
If your file naming is consistent, this is trivial.
{File.Name|splitlist:-,0} returns "reddit"
{File.Name|splitlist:-,1} returns "john doe"
{File.Name|splitlist:-,2} returns "cute persuasion"

In your MD template you set the Copyright URL tag from {File.Name|splitlist:-,0} and the PersonInImage tag from {File.Name|splitlist:-,1}.

Metadata templates don't fill Attributes, hence the name.
You can use the Attribute Importer (Ctrl+Q to open the Command Palette, type attr and pick the app from the result list).
Use {File.Name|splitlist:-,2} to fill the attribute of your choice.

No. You cannot run the Attribute importer automatically during ingest.
Create a favorite for it and click it after selecting all files.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Darius1968