Permlink Replies: 0 - Pages: 1
Laza

Posts: 1,732
Registered: 6-Sep-2005
Create custom slide variable
Posted: 13 Jan 20, 10:42
  Click to reply to this thread Reply
Creates new slide variable based on existing one by filtering. You can use it with the Remove slide variable and the Rename slide variable tools.

This tool comes handy if you want to create a new custom slide variable based on an existing one. Here are some examples:

1. You'd like to extract the image serial from the file name, e.g. DSC000123.JPG or IMG_00123.JPG.

Source:
label

Rules: Cheat sheet
^[^\d]+_?(\d+)

Destination:
serialNo


As a result it will create a custom variable (See "Edit mode -> Variables") called "serialNo" with the values read from the file names. If the file name does not match this format (ANY non-numeric character followed by a few numeric characters) the new variable will not be created. If the variable already exists ("0123456") the new match will be incrementally added, e.g. "0123456,00123".

2. You need a custom variable - e.g. lighting type - which can be read from the file name, e.g.: Somename_LD.jpg=Daylight, Anothername_LA.jpg=Artifical light. This variable later can be used in the Filtering and Sort feature.

Source:
label

Rules:
.*_LD$=Daylight
.*_LA$=Artificial light

Destination:
lightType


This will result in a variable called lightType, which can have two values: "Daylight" and "Artificial light".

3. You need a single variable made up from various metadata fields.
Source:
meta.Color Space|meta.Icc profile.Color space

Rules:
(empty)

Destination:
colorSpace


This will create a variable, named "colorSpace" containing the value of the first (left to right) field found.

Download and double-click the attached BSH file to install. You'll find the tool at the "Tools -> External tools -> Create custom slide variable" menu.

Edited by: Laza on 22-Jan-2020 08:02
Version 1.1
  • Added status bar message on the currently processed folder
  • Displaying error message when memory runs out

Edited by: Laza on 22-Jan-2020 10:15
Version 1.2
  • Redesigned User Interface
  • Added relevant links

Edited by: Laza on 22-Jan-2020 18:04
Version 1.3
  • Added "Scope"; "Whole album" or "Current folder and below" or "Current folder"

Edited by: Laza on 11-Feb-2020 17:38
Version 1.4
  • Added possibility to specify multiple Source fields joined with pipe "|".
  • Added possibility to use meta. fields
  • Added "Presets"

Edited by: Laza on 21-Feb-2020 15:42
Version 1.5
  • Changed rules requirement from full match to partial match
  • With this change the built-in presets work as intended
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums