photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: Darius1968 on January 19, 2024, 05:52:43 PM

Title: Fill Metadata Via Filename
Post by: Darius1968 on January 19, 2024, 05:52:43 PM
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? 
Title: Re: Fill Metadata Via Filename
Post by: Mario on January 19, 2024, 06:17:03 PM
The first part is easy to do using a Metadata Template, thanks to IMatch variables and functions, namely splitlist:Split char,Index (https://www.photools.com/help/imatch/var_basics.htm?dl=h-219)
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.

Title: Re: Fill Metadata Via Filename
Post by: Darius1968 on January 19, 2024, 11:46:49 PM
Thanks.