Variables enable you to access almost all the data stored in your database. Many IMatch features allow the use of variables to customize the data displayed or processed.
Many IMatch features and functions support variables. Here are some examples:
A variable is just a bit of text following a specific syntax. All variables look like this:
{
Application.DateTime}
This above variable returns the current date and time, formatted using the format configured for the current user the Windows Control Panel.
{File.FullName}
This variable returns the fully qualified file name of a file, e.g. "c:\images\beach.jpg".
Some variables support additional arguments, which are appended to the variable name, separated by a pipe | symbol:
{Application.DateTime|format:YYYY}
The argument format:YYYY tells IMatch to output only the year part of the date, e.g. "2012".
The general syntax for variables is:
{Variable Name|Arguments}
The surrounding braces { } and the variable name are mandatory, the |Arguments part is optional.
{Application.Version} {User.Name} {File.FullName} {File.DateTime} {File.Rating} {File.Size}
Example output:
2020.11.4 Mario c:\images\beach 24.05.2023 12:33:11 5,00 36,2 MB
Usually you just enter the variable name using the syntax described above. In most cases you can freely mix variables with literal (free) text:
The name of this file is {File.FullName}.
The output of this statement would be something like this:
The name of this file is c:\images\Beach.jpg.
You don't need to memorize variable names!
You just select them in the Variables Selectors dialog box, which is accessible from all features which allow the use of variables. Look for this button:
Before we go into the details of variables and explain all the details, please look at these example uses. This makes it easier to understand the concept behind variables and shows how you can use them to customize IMatch to your personal requirements.
In the slide show configuration you use variables to specify the contents of the text overlay:
The Slide Show offers some dedicated variables which can only be used in the slide show.
In the Renamer you can use variables mixed with literal text to produce file names based on metadata:
The file window tip pops up when you point at the info icon visible in each thumbnail panel. The data shown in the tip is configured using variables.
The first example uses only the file name and the date and time the image was taken:
The second example uses additional variables and also some formatting attribute to create a much more advanced version of file window tip:
Depending on which feature you use, different sets of variables are accessible. The Application and User variables are always available. The File variables are also available for features which work with files, and also the Shortcode Variables, which cover most frequently used metadata tags.
Some features provide additional variables, which are available only within that specific feature. One example would be the Renamer or Design & Print, which offer special variables only useable within these features.
In all IMatch features which allow the use of variables you can pick variables from the Variable Selector dialog box. The dialog lists all variables available in the current scope.
The Variables tab in the dialog shows all standard variables: Application, User, File and Shortcodes. The Last recently used tab list the 50 last recently used variables for quick access.
If the Variable Selector dialog can determine a current file, it shows the actual value of each variable in the tooltip.
IMatch provides a large number of ShortCodes for all frequently used metadata tags. These variables are shorter and much easier to remember than the actual metadata tag. For example, {File.MD.description}
or {File.MD.aperture}
or {File.MD.gpslatitude}
which produces the same result as {File.MD.XMP::exif\GPSLatitude\GPSLatitude}, but is much shorter.
Always use ShortCodes, where available. They are not only shorter and easier to remember, but they also shield you from potential changes in the actual tag name.
Sometimes ExifTool has to rename a tag and then your variable will not longer produce the correct result. If you use ShortCodes instead of the actual tag name, your variable will work as before - because the change in the tag name is hidden by the ShortCode.
If no ShortCode is available for the tag you want to use in your variable, use the full tag name. For this, the Variables Selector gives you direct access to the Metadata Tag Selector.
Metadata variables give you access to all the metadata stored in the IMatch database. This includes IPTC, EXIF, XMP, ID3, PDF and other metadata tags.
See Introduction to Metadata for more information about metadata.
If you want to use metadata variables (File.MD.), click on the Tag Selector... button. It opens the standard Tag Selector dialog which allows you to select metadata variables comfortably. See below for more information on metadata variables.
You can copy properly formatted metadata variables into the Windows clipboard right from the Tag Selector dialog. Use this to transfer metadata variables from the dialog into the feature where you want to use the variables. Or, copy all the variables you frequently use into a small text file and keep this for reference.
IMatch provides a set of variables which allow you to access the current date and time, special folders locations and more. These variables are available in all contexts and are especially useful in scripts.
Variable Name | Description |
---|---|
Application.Name | Returns the name of the application: "IMatch". |
Application.Version | Returns the version of the application in the format major.minor.build, e.g. "5.0.20". |
Application.ComputerName | Name of the computer, e.g. "MARIOS PC". |
Application.IMWS.PortNumber | The port number on which the IMatch Anywhere™ WebServer integrated in IMatch is listening. The actual port number may differ from the port number configured under Edit > Preferences > Application when the configured port was not available. IMatch shows the actual port number used in the Info & Activity Panel and in the Dashboard. This variable makes the port number accessible everywhere variables can be used, e.g. in Favorites. Use it with |
Application.AppFolder | The fully qualified folder path to the IMatch program files folder, usually "c:\program files(x86)\imatch*". |
Application.AppDataFolder | The application data folder. |
Application.ConfigFolder | The fully qualified path of the IMatch configuration folder. |
Application.ResourceFolder | The fully qualified path of the IMatch resource folder. This folder contains presets and other resources used by IMatch. |
Application.DateTime | The current date and time. |
Application.TimeZone | The time zone offset of the local time zone to UTC. E.g. for Germany, this variable returns +01:00 or +02:00 (daylight saving time in effect). |
Application.UTCOffsetInMinutes | Returns the local time zone offset in minutes. For example, if your time-zone is +02:00, this variable returns 120. This variable may be useful if you want to to math with time zone offsets to maybe change non-standard timestamp tags with the Metadata Mechanic, a Metadata Template, AutoFill or similar. |
Application.Workspace.Name | The name of the last workspace actively loaded by the user. Note: This name is not updated when the current workspace settings are saved under a new name. |
Application.Database.Name | The name of the currently loaded database, e.g. IMatchDatabase |
Application.Database.QualifiedName | The fully qualified name of the currently loaded database, e.g. c:\imdb\IMatchDatabase.imd5 |
Application.ProtectedFiles.Visible | Returns "Yes" if protected files are visible, else "No". |
Application.Monitor.DPI.Horizontal | Horizontal DPI (dots per inch) of the monitor containing the main IMatch window. Usually something between 96 and 240. |
Application.Monitor.DPI.Vertical | Vertical DPI (dots per inch) of the monitor containing the main IMatch window. Usually something between 96 and 240. |
Application.Monitor.Resolution.Horizontal | Horizontal resolution in pixel of the monitor containing the main IMatch window. |
Application.Monitor.Resolution.Vertical | Vertical resolution in pixel of the monitor containing the main IMatch window. |
Application.Database.ListSeparator | Returns the list separator used by IMatch for separating elements in lists. This is configured to ; by default under Edit > Preferences > Metadata and should usually never be changed.IMatch uses this, for example, to separate lists of values in variables. |
Application.System.ListSeparator | Returns the list separator string defined in the Windows numeric settings for the current user. |
Application.System.GroupingSymbol | Returns the 1000 grouping string defined in the Windows numeric settings for the current user. This string is used when formatting numbers greater than 1000, e.g. 100,000 or 100'100 . |
Application.System.DecimalSymbol | Returns the decimal symbol string defined in the Windows numeric settings for the current user. This string is used when formatting decimal digits, e.g. 100.35 or 100,35 . |
Application.System.CurrencySymbol | Returns the currency symbol string defined in the Windows numeric settings for the current user. This string is used when formatting decimal currency values, e.g. 100.35$ or 100,35€ . |
Application.GUID | Returns a globally unique identifier (GUID) as a 36-character string on every call. An example GUID would be A73F0668-C99E-4285-9BD0-D007349136CA .Use this variable if you need a unique identifier for something, e.g. a metadata tag. |
Application.RandomNumber | This variable returns a random number in the range [0,1) (>= 0 and < 1). Use something like |
These variables allow you to retrieve some user-related data:
Variable Name | Description |
---|---|
User.Name | The name of the currently logged in user. |
User.PersonalFolder | The application data folder for the current user. |
User.DocumentsFolder | The Windows "Documents" folder for the current user. |
User.ImagesFolder | The Windows "Images" folder for the current user. |
You can configure application variables under Edit > Preferences > Variables.
These user-defined variables enable you to manage frequently used text fragments like your copyright notice, address, agency code etc. in one central place.
You can use them everywhere you can use variables, e.g., in the Renamer, text export modules etc. Keeping stationary data like your copyright notice or studio name in a variable allows you to change all occurrences of this stationary at one single place.
The syntax for this type of variable is:
{Application.Variables.Name of Variable|Arguments}
Name of Variable is the name of the variable you specified under Edit > Preferences > Variables. The |Arguments part is optional.
For example, if you create two variables MyCopyright and CompanyName, the corresponding variables will be accessible as:
{Application.Variables.MyCopyright} {Application.Variables.CompanyName}
Some variables may return multiple values. For example, the variable {File.MD.hierarchicalkeywords}
returns the keywords of a file. If the file has multiple keywords, the variable separates them with the IMatch list separator configured under Edit > Preferences > Metadata. This is by default a semicolon
and you should not change it under normal conditions.
A file has the hierarchical keywords:
Location|Country|Italy Motive|Landscape Motive|Family
The variable {File.MD.hierarchicalkeywords}
(which is a short code) returns:
Location|Country|Italy;Motive|Landscape;Motive|Family
Each keyword in the file, separated with the IMatch list separator.
This behavior is the same for all variables which return lists, e.g., {File.Categories}
, {File.Pins}
, {File.Persons.Label}
or {Files.MD.creator}
.
You can use the replace: function to replace the default list separator in the variable output. For example:
{File.MD.hierarchicalkeywords|replace:~;==, }
replaces the ;
with ,
to produce:
Location|Country|Italy, Motive|Landscape, Motive|Family
These variables provide information about each file indexed by your IMatch database. You will use these variables frequently. Together with the metadata variables they give you full access to almost all the data contained in your database.
The syntax for this type of variable is:
{File.Name of Variable|Arguments}
The "File." prefix and the variable name are mandatory, |Arguments is optional.
{File.FullName} {File.DateTime|format:YYYY}
File Variables | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
File.OID | The unique number (OID: object identifier) IMatch assigns to each file. This number is used for internal purposes and may change at any time. | ||||||||||||||||||||
File.LTID | A globally unique identifier (GUID) IMatch assigns to each file when it is first added to the database. This identifier does not change as long as the file remains in the database. It uses the standard GUID format, e.g.: A8215BFA-5AEE-4C23-B463-5E7B7D1E7488 | ||||||||||||||||||||
File Names and Folders | |||||||||||||||||||||
File.NameExt | Name and extension of the file: "beach.jpg" | ||||||||||||||||||||
File.FullName | Fully qualified file name: "c:\images\2012\beach.jpg" | ||||||||||||||||||||
File.Name | File name without extension: "beach" | ||||||||||||||||||||
File.Ext | File extension: ".jpg" | ||||||||||||||||||||
File.Folder | Folder name: "2012" | ||||||||||||||||||||
File.Path | Path with trailing backslash: "c:\images\2012\" | ||||||||||||||||||||
File.Folder.FriendlyName | Returns the friendly name of the folder containing the file, or an empty string if the folder has no friendly name. | ||||||||||||||||||||
File.Folder.Description | Returns the description of the folder containing the file. | ||||||||||||||||||||
File.Folder.Media.SerialNumber | Returns the serial number of the media containing the folder. | ||||||||||||||||||||
File.Folder.Media.Label | Returns the label of the media containing the folder. | ||||||||||||||||||||
File.NameExtS | These variables are identical to the variables without the "S", but use the short file names supplied by Windows for FAT-formatted media. See the Windows help for details. | ||||||||||||||||||||
File.FullNameS | |||||||||||||||||||||
File.NameS | |||||||||||||||||||||
File.ExtS | |||||||||||||||||||||
File.FolderS | |||||||||||||||||||||
File.PathS | |||||||||||||||||||||
File.CacheFileName | IMatch maintains cached JPEG files for the files in the IMatch database (see The Cache for details). This variable returns the name of the associated cache file, or an empty string if no cache file exists. The returned cache file is determined applying the appropriate relation rules for visual proxies. | ||||||||||||||||||||
Image Information | |||||||||||||||||||||
File.Class | The class of the file as maintained by IMatch, e.g. "image" or "audio" | ||||||||||||||||||||
File.Format | The format tag associated with the file format, e.g. "MP3" or "JPEG". A file format manages one or multiple file extensions. | ||||||||||||||||||||
File.Size | The size of the file on disk, in bytes. | ||||||||||||||||||||
File.Megapixel | Returns (Width * Height) / (1000 * 1000). For a file with 3000 x 4000 pixels, this variable returns 12. The data type is real so you can use cast and format as needed. | ||||||||||||||||||||
File.CRC | The 32-Bit checksum of the file, e.g. 3.064.782.803. | ||||||||||||||||||||
File.CRC.Hex | The 32-Bit checksum of the file in hexadecimal format, e.g. B6ACDFD3. | ||||||||||||||||||||
File.Width | Width in pixels. This variable returns 0 if the file is not an image. | ||||||||||||||||||||
File.Height | Height in pixels. This variable returns 0 if the file is not an image. | ||||||||||||||||||||
File.LongEdge | Returns the number of pixels for the longest edge. For an image with 800 x 600 pixel, this returns 800. | ||||||||||||||||||||
File.ShortEdge | Returns the number of pixels for the shortest edge. For an image with 800 x 600 pixel, this returns 600. | ||||||||||||||||||||
File.BPP | Bits per pixel (e.g. 24). This variable returns 0 if the file is not an image. | ||||||||||||||||||||
File.AspectRatio | The aspect ratio of the file:
The variable returns 0 if the file if no aspect ratio can be determined (e.g. for text files or other files with width/height 0). | ||||||||||||||||||||
Date and Time | |||||||||||||||||||||
File.Added | Date and time the file was added to the database. This information is extracted from the file history maintained by IMatch. | ||||||||||||||||||||
File.Updated | Date and time the file was last updated in the database. This information is extracted from the file history maintained by IMatch. | ||||||||||||||||||||
File.Created | Date and time the file was created on disk (as reported by the Windows file system). Note: This variable is expensive to calculate because IMatch has to query the file system for this information every time it is requested. It is not cached in the database. | ||||||||||||||||||||
File.Modified | Date and time the file was last modified on disk. This is the same timestamp you see in Windows Explorer. | ||||||||||||||||||||
File.DateTime | Returns the original value of the global File.DateTime timestamp IMatch maintains for all files in the database.The date and time is formatted using the date and time format configured for the current user in Windows. You can change the format with the format function. See How IMatch uses Date and Time for more information. | ||||||||||||||||||||
File.DateTime.TZO | Returns the same timestamp as File.DateTime but with the time zone offset appended.If File.DateTime returns a timestamp like 8/16/2023 12:00:00 and the time zone offset recorded for File.DateTime is +04:00, File.DateTime.TZO returns 8/16/2023 12:00:00+04:00. | ||||||||||||||||||||
File.DateTime.UTC | Returns the value of the global File.DateTime timestamp in UTC, with or without the Z indicator. | ||||||||||||||||||||
File.DateTime.UTCOffsetInMinutes | Returns the time zone offset in minutes (positive or negative) used to calculate the global File.DateTime timestamp. This makes the offset easily accessible for custom formatting and calculations.See How IMatch uses Date and Time for more information. | ||||||||||||||||||||
File.DateTime.UTCOffset | Returns the formatted (+/-HH:MM or Z) value of File.DateTime.UTCOffsetInMinutes. | ||||||||||||||||||||
File.DateTime.Original | Returns the same timestamp as File.DateTime and File.DateTime.TZO , respectively. | ||||||||||||||||||||
File.DateTime.Local | Converts the global File.DateTime timestamp into the current local time zone (as set in Windows), accounting for daylight saving time (DST). If the .TZO variant is used, the local time zone is appended. | ||||||||||||||||||||
Example:Here is an example that shows the results of all the various File.DateTime.* variables.
| |||||||||||||||||||||
File.MetadataImport | Date and time of the last metadata import in local time. | ||||||||||||||||||||
File.MetadataImport.UTC | Date and time of the last metadata import in UTC. | ||||||||||||||||||||
File.MetadataWriteBack | Date and time of the last write-back in local time. If the file was never written back, this returns 0. Available since IMatch 2023.3.4. | ||||||||||||||||||||
File.MetadataWriteBack.UTC | Date and time of the last metadata import in UTC. If the file was never written back, this returns 0. Available since IMatch 2023.3.4. | ||||||||||||||||||||
File.Duration | This variable returns the duration (play length) of the file in seconds. It is available for many video and audio formats. | ||||||||||||||||||||
File.Duration.HMS | This variable returns the duration (play length) of the file in HH:MM:SS (Hour:Minute:Second) format. | ||||||||||||||||||||
File Status | |||||||||||||||||||||
File.ReadOnly | Returns "No" or "Yes" (translated to your local language), depending on whether the file is read-only on disk or not. | ||||||||||||||||||||
File.PendingUpdate | If the file needs to be refreshed/reloaded, this variable returns "Yes", else "No". | ||||||||||||||||||||
File.MetadataModified | Returns "Yes" if the file has pending metadata updates (pending write-back), else "No". | ||||||||||||||||||||
File.Offline | Returns "Yes" when the file is off-line, else "No". | ||||||||||||||||||||
File.Protected | Returns "Yes" when the file is protected, else "No". See also Application.ProtectedFiles.Visible above. | ||||||||||||||||||||
Collections | |||||||||||||||||||||
File.Bookmark | Returns "Yes" when the file has a bookmark, else "No" | ||||||||||||||||||||
File.Flag | The title of the flag of the file or an empty value if the file has no flag. | ||||||||||||||||||||
File.Dot | The color of the dot or an empty value if the file has no dot. | ||||||||||||||||||||
File.Pins | List of all pins set for the file, separated by ; . Returns an empty value if the file has no pins. | ||||||||||||||||||||
File.Label | The name of the assigned label or an empty value if the file has no label. | ||||||||||||||||||||
File.LabelColor | The color associated with the file label, formatted in the standard HTML color format: #rrggbb, where rr is red, gg is green and bb is blue. Returns #ffffff (white) if the file has no label or no color was configured for the label. | ||||||||||||||||||||
File.Rating | The file rating. -1.0 for rejects, 1.0-5.0 for the corresponding rating, empty value if the file has no rating. The XMP rating tag is a floating point number. It will be formatted with decimals ("3.00") unless you use the cast:int formatting argument to change this ("3"). IMatch formats floating point variables using the settings of the current locale (Windows Control Panel > Regional Settings). | ||||||||||||||||||||
File.Relations | Textual expression of all Relations (master/version) of this file. | ||||||||||||||||||||
File.Versions | List of fully-qualified version file names. Only available for master files. | ||||||||||||||||||||
File.Versions.NameExt | List of version file names (name.ext). Only available for master files. | ||||||||||||||||||||
File.BuddyFiles | List of fully-qualified buddy file names for this file. | ||||||||||||||||||||
File.BuddyFiles.NameExt | List of buddy file names (name.ext) for this file. | ||||||||||||||||||||
File.Relations.IsMaster | True when the file is a master. | ||||||||||||||||||||
File.Relations.IsVersion | True when the file is a version. | ||||||||||||||||||||
File.Relations.Color | The color, if a color was assigned to the file relation. Else Null. | ||||||||||||||||||||
File.Relations.Stack.Count | The number of versions (elements in the version stack, including the master). This variable is only filled for masters. | ||||||||||||||||||||
File.Relations.Stack.State | Returns "expanded" or "collapsed". | ||||||||||||||||||||
File.Stack.IsTop | Returns Yes if this is a stack top. | ||||||||||||||||||||
File.Stack.IsElement | Returns Yes if this file is stacked (but not a stack top). | ||||||||||||||||||||
File.Stack.Color | The color, if a color was assigned to the stack. Else Null. | ||||||||||||||||||||
File.Stack.Count | The number of files in the stack. | ||||||||||||||||||||
File.Stack.State | Returns "expanded" or "collapsed". | ||||||||||||||||||||
File.Annotations | Textual expression of all Annotations of this file. | ||||||||||||||||||||
Categories | |||||||||||||||||||||
File.CategoriesFile.Categories.DirectFile.Categories.DirectNoAlias | A list of all categories containing this file, including data-driven categories and categories referencing this file via a formula. The Direct variable only returns the categories to which the file is directly assigned; it ignores data-driven categories and formulas. The DirectNoAlias works the same but ignores Alias categories. This can be very useful, e.g. if you want to extract categories under a parent category (e.g. "Family") and don't want all Alias categories from that hierarchy to be included. if you link the same person into multiple sections of the Family hierarchy, you may want to count it only once. Example: {File.Categories.DirectNoAlias|filter:^People;count:true} This variable counts the number of categories under the @All|People hierarchy a file is assigned to. Alias categories are ignored. | ||||||||||||||||||||
File.Categories|level:rootFile.Categories.Direct|level:root | Returns the root categories (top-level categories) Location; Style | ||||||||||||||||||||
File.Categories|level:leafFile.Categories.Direct|level:leaf | Returns the bottom-level categories Daytona; Landscape | ||||||||||||||||||||
File.Categories|level:0File.Categories.Direct|level:0File.Categories|level:1File.Categories.Direct|level:1... | By specifying a level you can access individual levels of your category hierarchy. Level 0 is identical with root, level 1 is the level below the root and so on. You can also use negative levels to address levels starting at the leaf: level-1 means the level above the leaf, level-2 means the category two levels above the leaf etc. Using an index allows you to address specific levels, even when the total number of levels in your hierarchy is unknown or varies. Example: We use this category hierarchy for this example: Location|Outdoor|Beach|Daytona
The VarToy App is a always helpful to run tests with variables and to just try things out. | ||||||||||||||||||||
Filtering Category Variables See the Combining Category | |||||||||||||||||||||
File.Categories|filter:RegExp | The filter function allows you to filter the categories of a file by a regular expression, identical to the @Category[] category formula. For example:{File.Categories.Direct|filter:^Gender} This variable returns only categories matching the regular expression ^Gender, which are all categories starting with the term Gender, e.g. "Gender|Male", "Gender|Female". The following expression returns only categories under the Persons root category, and from here only the leaf level:{File.Categories|filter:^@Keywords;level:leaf;replace:~;==, } This variable emits all leaf-level keywords of a file (only categories beginning with @Keywords) by applying a level:leaf formatting function. It also replaces all ; in the returned text with , <blankk> to allow the list to word-wrap, e.g. in File Window Layouts.{File.Categories.Direct|filter:^Persons;level:leaf}If you have categories like 'Persons|Family|John', 'Persons|Family|Mary', 'Persons|Business|My Company', ... this variable first finds out to which categories starting with Persons the current file is assigned, and then returns the leaf category. This is a very powerful function which can help you solve tricky requirements. For example, you can use this to control which categories you want to see, e.g. in the File Window or the Viewer or a Batch Processor text overlay. Such a construct allows you to output only the Person category to which a file is assigned. It does not matter to how many other categories the file is assigned as well. This can be very useful for situations where you want to output the Family assignment only. Of course this also works with other category names, even on lower levels: {File.Categories.Direct|filter:blue} This variable returns all categories for the current file which contain the word blue somewhere in their fully qualified name.{File.Categories.Direct|filter:blue$} Returns all categories for the current file which end with the word blue.Tip: Counting the number of people in an image Assuming you assign keywords like Persons|Bill or Persons|Mary to your files, you can use this variable to determine the number of Persons categories assigned to an image:{File.Categories|filter:^@Keywords\|Persons;count:true}Then you can use the resulting number e.g., in Metadata Templates or to produce a data-driven category. |
level
and filter
If you use both filter
and level
, the order in which these appear in the variable matters.
If filter
appears before level
, the filter expression is applied to the entire category path. And then the requested level is returned. If level
appears first, the filter expression is only applied to the selected level.
Consider a category name like WHERE|Outdoor|Beach
.
{File.Categories|filter:beach;level:1} | Returns Outdoor |
{File.Categories|level:1;filter:beach } | Returns nothing |
The second variable uses level before filter and the filter expression is thus applied to the word Outdoor, which does not match beach.
These variables return information about persons shown in the image. Using these variables allows you to display the names of these persons, their age (relative to the date of the image) and other useful data.
All File.Persons.*
variables may return zero to many values. If a file has no face data or none of the faces has a person assigned, the variables return nothing. If a file has two or more persons, the variables return the data as a list, separated with a semicolon: Peter;Paul;Mary
. You can use the index function to access data of specific persons in that list.
File.Persons.OID | The unique number (OID: object identifier) IMatch assigns to each person. This number is used for internal purposes and may change at any time. |
File.Persons.Tag | The person tag. |
File.Persons.Age | The age of the person, relative to the file. This variable allows you to display the age of the person in the image at the time the image was taken. This variable (and all other 'Age' variables) uses the file date and time for each file. It is produced from a variety of metadata tags, depending on the file format. See How IMatch uses Date and Time Information for more information. This date is accessible via the {File.DateTime} variable.Example:{File.Persons.Age}returns something like 34 or 9 months . When the age is less than two years, only months are returned.If the day of death property for the person is filled, it is considered when calculating the age. |
File.Persons.Age.Verbose | The verbose age of the person in years and months, relative to the file.Example:{File.Persons.Age.Verbose}returns something like 24 years and 3 months or 24 Jahre und 3 Monate (when you are in Germany).If the person is less than two years, only months are returned. |
File.Persons.Age.Years | Returns the person's age in years. |
File.Persons.Age.Months | Returns the person's age in months (for example, 24 is the person is exactly two years old). |
File.Persons.Age.Remainder | Returns the remainder of age in months divided by 12 (age in months modulo 12). This variable allows you to produce individual age formats. For example, output 'and a bit' if the remainder is less than 3. Or 'and a half' if the remainder is >= 6. Whatever you prefer or is custom in your country.Example{File.Persons.Age.Remainder}returns 3 if the person is 15 months old (1 year and 3 months). Or 7 if the person is 31 months old (two years and 7 months). |
File.Persons.Age | The Age variables described above calculate the age of the person relative to the image. A secondary set of age variables exists. These variables calculate the age of a person based on the current date and time. Use these variables to work with the actual age of the person. The following variables are available. They work exactly as the Age variables documented above, but use the current date and time:
|
The following variables give access to all the person properties you can fill in the Person Editor. Note that all these fields are optional. If a field is not filled for a person, the variable returns an empty result. If a field, like other names, contains multiple values, the values are returned as a comma-separated list. The Notes property is intentionally not available as a variable. It can only be seen and modified in the Person Editor. | |
File.Persons.Label | The contents of whatever you have configured to be used as the persons label. |
File.Persons.FullName | Full name. |
File.Persons.BirthName | The birth name (maiden name). |
File.Persons.ShortName | Short name. |
File.Persons.OtherNames | Other names. A repeatable field. |
File.Persons.Description | Description. |
File.Persons.DOB | Birth date. |
File.Persons.PlaceOfBirth | A description of the place of birth. |
File.Persons.DOD | Death date. |
File.Persons.PlaceOfDeath | A description of the place of death. |
File.Persons.Gender | Gender. |
File.Persons.SortExpression | Sort by. |
File.Persons.Id | User-defined Id. |
File.Persons.Url | Web address. |
File.Persons.Email | Email. |
File.Persons.Address | Address. |
File.Persons.Occupation | Occupation. |
File.Persons.Title | Title. |
File.Persons.Keywords | Keywords to assign when this person is assigned to a file. |
File.Persons.Categories | Categories to assign when this person is assigned to a file. |
Person Groups | |
---|---|
A person can be assigned to (be a member of) any number of groups. | |
File.Persons.Groups | The groups this person belongs to. |
File.Persons.Groups.Color | The group color. |
File.Persons.Groups.Descriptions | The group description. |
Family Variables | |
A person can be assigned to (be a member of) any number of families. | |
File.Persons.Families.Tag | The unique tag for the family. |
File.Persons.Families.Name | The family name. |
File.Persons.Families.Description | The family description. |
File.Persons.Families.Color | The family color. |
File.Persons.Families.Email | The family's email address. |
File.Persons.Families.Url | The family's web site address. |
A typical use-case for this type of variable is to list the persons in an image in a File Window layout or to print them as a caption next to the image with Design & Print.
{File.Persons.Tag|replace:~;==, }
This variable enumerates all persons in the image and lists them. The ; separator used in case there are multiple persons in the image is replaced with a comma and a space.
Peter, Paul, Mary
{File.Persons.Tag|foreach:{value} ({File.Persons.Age.Years|index:{index}}) }
For each person the tag and, in (), the age in years is printed.
Peter (33) Paul(35) Mary (28)
To separate the individual tokens produced by the foreach
function, we can add some more code:
{File.Persons.Tag|foreach:{value} ({File.Persons.Age|index:{index}}){remaining|is:0,,{remaining|is:1, and ,+ ;replace:+==,}}}
This variable lists all persons in the image. For each person the age is added in (). All persons are separated with , except for the last person, which uses and.
Peter (33), Paul(35) and Mary (28)
These variables give access to the faces detected in the image. They may be helpful in certain situations.
All variables return a list of zero to n values, separated with a semicolon. You can use functions like foreach
, count
and similar to access individual faces.
File.Faces.OID | The unique face id of the face. | ||||||||||
File.Faces.Confidence | The confidence [0 to 1] of the assigned person. | ||||||||||
File.Faces.Confirmed | Yes if this face is confirmed, else No. The Yes/No values use the corresponding term in your language, if supported by IMatch. Else the English terms Yes/No are used. Use | ||||||||||
File.Faces.Trained | Yes if this face is used as a trained face, else No. | ||||||||||
File.Faces.Ignored | Yes if this face is ignored, else No. | ||||||||||
File.Faces.Arrangement.Type | The type of face arrangement. See Face Arrangement for details about how IMatch analyses faces in your files. If the file has no faces, this variable is empty. The following values are supported:
See the Face Arrangement topic for more information. | ||||||||||
File.Faces.Arrangement.Portrait | Returns Yes if the file is considered to be a portrait, else No. If the file has no faces, this variable is empty. | ||||||||||
File.Faces.Arrangement.CloseUp | Returns Yes if the file is considered to be a close-up, else No. If the file has no faces, this variable is empty. | ||||||||||
File.Faces.Arrangement.SmallFace | Returns Yes if the file has at least one face smaller than the configured small face size. If the file has no faces, this variable is empty. | ||||||||||
File.Faces.Arrangement.CloseTogether | Returns Yes if the file is considered to show faces close together, else No. If the file has no faces, this variable is empty. | ||||||||||
File.Faces.Arrangement.Links | Returns Yes if the file contains at least one person link, else No. If the file has no faces, this variable is empty. | ||||||||||
File.Faces.Arrangement | This variable combines all results of the face arrangement analysis into a list of strings, separated by a semicolon. For example: Group of Faces;Close Together or Multiple Faces;Small Faces;Links .This makes it easy to use the variable in File Window Layouts, descriptions or elsewhere. |
If you use IMatch Events to organize files, you can use event variables to access the event(s) a file is associated with. This makes it possible to display the event name in a file window, use it for Batch Processing, Design & Print and more.
File.Events.OID | The unique number (OID: object identifier) IMatch assigns to each event. This number is used for internal purposes and may change at any time. |
File.Events.Tag | The unique tag IMatch assigns to each event. |
File.Events.Title | The event title.Example:{Files.Events.Title}returns the name of the event this file is assigned to. If the file is assigned to multiple events, the variable returns a list of titles, separated with ;. |
File.Events.Description | The event description |
File.Events.Category | The name of the event category. If the event is not assigned to a category, this variable returns an empty result. |
File.Events.CategoryColor | The color of the event category as a HTML color value in the format: #RRGGBB . For example: #ff0000 for full red. |
File.Events.CategoryIcon | The internal name of the icon used for the event category. |
File.Events.Persons | The label of all persons associated with the event. |
File.Events.Links | The links for the event. |
Event Place | |
---|---|
File.Events.Place.Country | The country name of the event place. |
File.Events.Place.CountryCode | The ISO country code. |
File.Events.Place.City | State/Province. |
File.Events.Place.City | City name. |
File.Events.Place.PostalCode | Postal code / ZIP. |
File.Events.Place.Location | Location. |
File.Events.Place.SubLocation | Sub-location. |
File.Events.Place.Latitude | Latitude in decimal format. |
File.Events.Place.Longitude | Longitude in decimal format. |
File.Events.Place.Altitude | Altitude. |
When you work with Attributes in your database, IMatch makes all Attribute contents available via dedicated variables. This allows you to use Attribute data wherever you can use variables.
Attribute variables use the following syntax:
{File.AT.Set Name.Attribute Name|Arguments}
The File.AT. prefix is mandatory. Set Name is the name of the Attribute Set and Attribute Name is the name of the Attribute. The |Arguments part is optional.
If you have an Attribute Set named 'Submissions' and you want to display the contents of the 'Revenue' Attribute in that set, the variable name would be:
{File.AT.Submissions.Revenue}
Attribute variables can be selected comfortably from the Variables Selector dialog.
{File.AT.Info.Note} {File.AT.Submissions.Revenue|sum:true}
If your per-file attribute set contains reference attributes, you access them like any other attribute variable. But you can also access individual attributes of the global set. Consider the following example: You have a per-file Attribute Set named Info, and one global Attribute Set named Client:
Per-file Set: Info | |
---|---|
Attribute | Type |
Note | Text |
Date | Date |
Client | Reference, links to the global Attrubute Set Client via the Attribute Name |
Global Set: Client | |
---|---|
Attribute | Type |
Name | Text |
Hyperlink | |
City | Text |
Street | Text |
Phone | Text |
This allows you to use variables like
{File.AT.Info.Note} {File.AT.Info.Date} {File.AT.Info.Client}
The last variable above returns the Name attribute of the record to which the Info record links in the global set. This is also what you will see in the Attributes Panel.
In addition, you can also access other attributes in the global se as follows:
{File.AT.Info.Client.Name} ' This is the same as {File.AT.Info.Client} {File.AT.Info.Client.Email} {File.AT.Info.Client.City} {File.AT.Info.Client.Street}
These variables give you full access to all metadata stored in the database, including IPTC, EXIF, XMP, PDF and ID3 data. They use the same tags which are also used for the metadata panel.
Metadata variables use the following syntax:
{File.MD.Tag|Arguments}
The File.MD. prefix is mandatory. Tag is the full tag name of the metadata value you want to access. The |Arguments part is optional.
Metadata variables can be selected comfortably from the Variables Selector dialog.
For example, the standard tag "Model" contains the name of the camera model used to take a photo. The corresponding variable is:
{File.MD.Exif::Main\272\Model\0}
If you want to display the description you have entered for a file, you would use:
{File.MD.XMP::dc\description\Description\0}
Don't let yourself get confused about the long and sometimes cryptic names of these variables. You don't need to memorize them. Just select the variable you need in the Variables Selector dialog.
Some metadata tags allow for multiple values, e.g. IPTC/XMP keywords or the Creator/Authors. Metadata variables for these tags return a list with all values, separated by the list separator specified for the current locale in the Windows control panel.
For example, the output of a variable for a keyword tag looks similar to this:
location|beach;outdoor;sun;sand;vacation;holiday
You can change the separator used by a replace: formatting argument. See below for details.
Instead of the full tag key, you can use ShortCodes for many frequently used tags. See Table of Available ShortCodes.
There is a set of variables which can be used in File Window Layouts for custom templates.
See File Window Variables in the File Window Layouts help topic for more information and examples.
The optional arguments you can append to a variable allow you to format or change the variable contents. Not all variables support formatting arguments and all variables ignore unknown or unsupported formatting arguments.
Formatting arguments are specified as key:value pairs after a separating pipe | character. The general syntax is:
{Variable|key:value; key:value; ...}
Formatting arguments are separated with a semicolon ; . The last argument does not need a terminating semicolon.
{File.DateTime|format:YYYY}
Extracts only the year from the datetime variable.
{File.Rating|cast:int; replace:0==No Rating}
Treat the rating of the file as an integer ("3" instead of "3.00") and to output the text "No Rating" if the rating is "0".
These formatting arguments are available for numeric variables:
Type | Description |
---|---|
int | For floating-point variables. Force the value to an integer (applying the standard rounding if necessary). {File.Rating} => 1,00 {File.Rating|cast:int} => 1 |
int | For string variables. Force the string to be treated as a number and formatted using the current locale. The cast then strips the thousand grouping character so a string like 2.345 (or 2,345 ) becomes 2345 .If you apply this to a non-numeric variable, the outcome is undefined and usually 0. |
int | For Boolean variables. If the variable is true, 1 is returned, else 0. Without a cast, Boolean variables return the language-specfic tern for "Yes" and "No". German users will see "Ja" and "Nein", for example. If you plan using Boolean variables in comparisons, e.g. the is: formatting function, it's better to use a cast so you can compare against the non-language specific values 1 and 0: {File.Bookmark|cast:int;is:0,Nope!;is:1,Yippee!} |
real | For floating point variables. Removes the formatting applied by default by IMatch to variables, including the thousand grouping characters. The decimal point is formatted using the current locale (, or .). |
negate | For Boolean variables. Negates (inverts) the result. If the value is true, false is returned and vice-versa. |
negateint | For Boolean variables. Negates the variable and then converts it into 1 or 0. If the variable is true, the result will be 0, or 1 if the variable is false. |
hex | Format the value as a hexadecimal number:1 => 1 10 => A 15 => F |
roman | Format the value as a roman number:1 => I 10 => X 15 => XV |
If your numeric settings (Windows control panel) use the same character for the list separator and the thousand grouping symbol or decimal comma/point, (e.g, a comma ,
), the cast operator no longer processes lists of values and assumes that the value to cast is not a list. There is no way to tell if 1,234,567
is the number 1234567
or a list of numbers 1
234
567
in this case.
Metadata variables give you access to metadata like IPTC, EXIF or XMP. IMatch uses the default formatting as provided by ExifTool.
For all metadata values imported via ExifTool, IMatch, caches both the formatted value and the so-called raw value (numerical value) if delivered by ExifTool. A raw value is a numerical value stored inside the metadata block which has a textual representation or translation.
Not all metadata tags have a raw value. ExifTool also does not deliver a raw/numerical value when it is identical to the formatted value.
Some examples are:
Metadata Tag | RAW Value | Formatted Value |
---|---|---|
GPS Longitude | 8.525201 | 8 deg 31' 30.72" |
ExternalFlashFirmware (Nikon) | 1 1 | 1.01 (SB-800 or Metz 58 AF-1) |
ExposureProgram | 7 | Shutter speed priority AE |
Exif-ShutterSpeedValue | 0.00625 | 1/160 |
Variables | RAW Value | Formatted Value |
{File.Size} | 2.201.394 | 2,10 MB |
By default, all metadata variables return a value formatted using the data type of the metadata tag. This is the best choice for almost all situations. But sometimes you may want to access the raw value instead, or the unmodified formatted value as delivered by ExifTool.
To access the raw value, you can use the raw and rawfrm formatting arguments:
{File.MD.XMP::exif\GPSLongitude\GPSLongitude\0} => 8 deg 31' 30.72"
{File.MD.XMP::exif\GPSLongitude\GPSLongitude\0|value:rawfrm} => 8.525201
To access the original formatted value, you can use the value:formatted formatting argument:
{File.MD.Composite\Exif-ShutterSpeed\ShutterSpeed\0} => 0.01
{File.MD.Composite\Exif-ShutterSpeed\ShutterSpeed\0|value:formatted} => 1/160
Exif-Shutterspeed has a data type of real (a floating point number) so the value returned by IMatch will be 0.01 (rounded from 0.00625) using the numeric format as defined in the Windows Control Panel. To override this and to use the text value produced by ExifTool, use the value:formatted attribute.
value:formatted | Returns the original formatted value as delivered by ExifTool. |
value:raw | Returns the raw/numerical value or an empty string if there is no raw value. IMatch uses the data type of the metadata tag to format the value for output. Not all tags support raw/numerical values. If you use value:raw , the variable returns an empty result in that case. |
value:rawfrm | Returns the raw/numerical value if there is one, or the formatted value otherwise. IMatch uses the data type of the metadata tag to format the value for output. |
Note that the formatted and raw/numerical value may differ until the file is written back. ExifTool produces the formatted value for tags when IMatch ingests metadata (during the initial ingest, when the file is changed or when metadata is written back). IMatch in some cases (e.g. for GPS coordinates) works with and modifies the raw value and this may result in an empty formatted value or a mismatch between the raw and formatted value until metadata is written to the file.
See also Metadata Panel Layouts for additional info.
IMatch and ExifTool use a standardized ISO format for working with date and time data. This avoids issues caused by country-specific date- and time formats. The format used is:
YYYY:MM:DD hh:mm:ss{time zone +/- hh:mm or Z}
where the time zone is optional.
Examples: 2020:12:01 12:11:10
or 2020:01:29 17:52:19+02:00
or 2021:03:17 19:18:17Z
Date- and time variables in IMatch are by default formatted in your local date and time format. For example:
{File.DateTime}
returns 13.07.2021 18:14:31
for a German user but 13/07/2021 06:14:31pm
or 2021-07-13 06:14:31pm
in the US.
When you use a variable to fill a date- and time metadata tag (for example you copy date and time data from one tag into another or you use Attributes variables) you have to make sure that you format the date correctly. ExifTool expects the standard ISO format YYYY:MM:DD HH:MM:SS
(with an optional time-zone offset or Z).
To create this format, just add a format
instruction to your variable:
{File.DateTime|format:YYYY:MM:DD hh:mm:ss}
Keep in mind that variables for date and time tags by default return the localized time, applying time-zone offsets as needed before returning the value. This can be important.
For example, consider the value 2020:08:07 09:42:55+04:00
stored in a tag like XMP::photoshop\DateCreated\DateCreated
(the date subject created tag). Depending on how you use the variable, you get different results. We used the time-zone GMT+01:00 (Germany) and the German date and time format for this example:
Original Tag Value | 2020:08:07 09:42:55+04:00 |
Variable | Result |
---|---|
The default behavior for date and time variables is to format the result according to the local date and time format, as set for the user in the Windows Control Panel. | |
{File.MD.XMP::photoshop\DateCreated\DateCreated\0} | 07.08.2020 06:42:55 |
Using the value:formatted function, we can access the original tag value as stored in the database. | |
{File.MD.XMP::photoshop\DateCreated\DateCreated\0|value:formatted} | 2020:08:07 09:42:55+04:00 |
If you use ShortCodes for variables, the same principles apply. | {File.MD.datecreated|value:formatted} | 2020:08:07 09:42:55+04:00 |
If you use a format function to format the variable, the local time format is used again. | {File.MD.datecreated|format:YYYY:MM:DD hh:mm:ss} | 2020:08:07 06:42:55 |
{File.MD.datecreated|format:hh:mm:ss} | 06:42:55 |
If you include the Z token in your format, the time-zone offset is emitted and the time is not converted to local time. | |
{File.MD.datecreated|format:YYYY:MM:DD hh:mm:ssz} | 2020:08:07 09:42:55+04:00 |
{File.MD.datecreated|format:hh:mm:ssz} | 2020:08:07 09:42:55+04:00 |
Both the z
and Z
token used with a time format string make the variable emit the time-zone offset and prevent conversion into the local time-zone. The difference between the two tokens comes into play when the time has no time-zone offset or the zero offset 00:00.
Assuming the source time is 08:32:51
: if you use z
, no time-zone offset is emitted in this case and you get 08:32:51
. If Z
is used, the variable emits 08:32:51Z
to indicate that this time value is assumed to be at UTC+00:00. For a time value with a time-zone offset like 08:32:51+02:00
, both tokens produce 08:32:51+02:00
.
IMatch provides some functional arguments which allow you to extract parts of the variable content, replace contents or supply default values.
prefix:Textpostfix:Text | This functions allows you to specify a text to prepend (prefix) or append (postfix) to the variable content. Both functions are only evaluated when the variable has content. This makes it possible to display text before and after the variable, but only if the variable is filled. Examples:
The | ||||||||||||||||||||||||||||||||||||||||
default:Text | Allows you to specify a default value. This value will be returned if the variable is NULL or an empty string. default behaves differently from other functions:
| ||||||||||||||||||||||||||||||||||||||||
defaultex:Text | This function is used for the same purpose as default, but behaves differently in two ways:
| ||||||||||||||||||||||||||||||||||||||||
hasvalue:Text | If the variable has a value (not NULL, not empty), it will be replaced with Text. This function is useful if you want to display/emit a specific value (or another tag) if a tag contains data. Examples:
Combine it with default to create if then else statements. For example: {File.MD.XMP::exif\GPSLatitude\GPSLatitude|default:No GPS data;hasvalue:Has GPS data}which returns "Has GPS data" if the file has a non-empty latitude, and "No GPS data" if the latitude tag is empty. You can also nest this if you want, to check for multiple variables. | ||||||||||||||||||||||||||||||||||||||||
length | Returns the length of the variable in characters. Examples:
| ||||||||||||||||||||||||||||||||||||||||
is:Value,TV,FV,case | This function compares the contents of the variable with the Value parameter. If there is a match, TV is returned, else FV. If case is true, the comparison is case-sensitive (default: false). FV and case are optional parameters. If you don't specify FV and the function evaluates to false, the original variable content is returned. Examples:
| ||||||||||||||||||||||||||||||||||||||||
contains:Value,TV,FV,case | This function searches the contents of the variable for the term Value. If found, TV is returned, else FV. If case is true, the comparison is case-sensitive. Both FV and case are optional. If you don't specify FV and Value does not match, the original content of the variable is returned. Examples:
| ||||||||||||||||||||||||||||||||||||||||
regexp:Regular Expression//!,TV,FV,case | This function performs a regular expression match and returns TV when there is a match or FV otherwise. If case has the value true, the comparison is performed case-sensitive. Default is false. Everything between the first
See Regular Expressions for more information. | ||||||||||||||||||||||||||||||||||||||||
find:Value,case | This function searches the contents of the variable for first occurrence of Value. If found, it returns the 0-based position of the term, else it returns -1. If the optional case parameter is true, the comparison is case-sensitive. Examples:
If you expect the function to return a value >= 1000, optionally apply the | ||||||||||||||||||||||||||||||||||||||||
findreverse:Value,case | This function searches the contents of the variable from the back for first occurrence of Value. If found, it returns the 0-based position of the term, else it returns -1. If the optional case parameter is true, the comparison is case-sensitive. Examples:
If you expect the function to return a value >= 1000, optionally apply the | ||||||||||||||||||||||||||||||||||||||||
numcomp:Op,Value,TV,FV,Mode | This function performs a numerical comparison between the variable and the term Value. It does this by first converting the variable value and the value specified as the second parameter into floating point numbers (real). Then it uses the given operator to determine the result. When Value is a number with digits (real), you must format it using a decimal point, not a decimal comma. If you get the Value from another variable, you need to make sure that the result of the variable has the correct format (e.g., by using a cast). Depending on whether the result is true or false, the TV or FV values are returned.Supported operators (Op):
Mode The optional Mode parameter can be specified as length. If you do this, numcomp does not use the value (content) of the variable, but calculates its length instead and uses that for the comparison. For example, a variable has the value "Duck". If you specify the mode as length, numcomp will use 4 when doing the comparison (the length of Duck). numcomp and Mode length can be used to limit the output length of a variable intelligently! Imagine you want to limit the output length of a variable to, say, 30 characters to prevent your file window layout to become cluttered. Or maybe you want to limit the text length used in the Batch Processor. To indicate that the text has been shortened you want to add an ellipsis (...). The following statement does this for the XMP description tag (we here use the tag shortcode instead of the long name): {File.MD.description|numcomp:gt,30,{File.MD.description|substr:0,30}...,{File.MD.description},length} We specify length as the last parameter. numcomp hence calculates the length of File.MD.description. If it is longer than 30 (gt 30) the TV is emitted, else the FV.We use {File.MD.description|substr:0,30}... as the TV (true value). This means that when the description is longer than 30 characters, we only emit the first 30 characters and append a ... FV (false value) is set to {File.MD.description} and this means that if the condition is not met (length of the description is <= 30) we emit the full description. Try it out in the VarToy App. More Examples:
| ||||||||||||||||||||||||||||||||||||||||
datecomp:Op,Value,TV,FV | This function compares two dates using the specified operator. Depending on whether the result is true or false, the TV or FV values are returned. The supported date and time formats are: "YYYY-MM-DD HH:MM:SS" and "YYYY-MM-DD". You must use the format function to produce one of these date and time formats (use format before you use datecomp!). Supported operators (Op):
Examples:
| ||||||||||||||||||||||||||||||||||||||||
duration: | This function compares the variable value with CompareDate and returns the difference in units.The variable must be in the format: For Supported Units:
These optional parameters allow you to control the output of the variable, depending on the value. If you don't want numeric output, but prefer human-readable text, supply these parameters. singular is used when the result of the function is 1. plural is used when the result is 2 or more. zero is used when the result is 0. All parameters can contain embedded variables. The
You can use the See also math: timediff. | ||||||||||||||||||||||||||||||||||||||||
between:Lower,Upper,TV,FV,Mode | Tests if the numerical value of the variable is >= Lower and <= Upper (less than or qual Lower and greater than or equal Upper). Returns TV if this the condition is met, else FV. When Lower/Upper are numbers with digits (real), you must format them using a decimal point, not a decimal comma. If you get the Value from another variable, you need to make sure that the result of the variable has the correct format (e.g., by using a cast). The optional parameter Mode has the same meaning as with numcomp above. If set to length, between uses the length of the variable in characters instead of it's value.Examples:
| ||||||||||||||||||||||||||||||||||||||||
strcomp:Value,LV,EV,GV,Mode | This method compares the string value of the variable with the given Value. Depending on the result of the comparison it returns LV (less than), EV (equal) or GV (greater than). The optional parameter mode allows you to control how the comparison is performed. Supported Modes (Mode):
Examples:
| ||||||||||||||||||||||||||||||||||||||||
substr:Start,Length | This function allows you to extract a part of the variable value. The first parameter is the 0-based index of the first character to extract; the optional length specifies how many characters to extract. If no length is given, the remainder of the value is returned. Examples:
| ||||||||||||||||||||||||||||||||||||||||
substrr:Start,Length | This function works like substr, but from the end of the variable value. Using substrr allows you to extract a part of the variable text from the end. Start is the 0-based index of the first character you want to extract from the end. The optional Length specifies how many characters you want to extract. If you want to extract all characters from Start to the beginning of the string don't specify Length. Examples:
| ||||||||||||||||||||||||||||||||||||||||
right:Length | Extracts Length characters from the end of the variable content. Examples:
| ||||||||||||||||||||||||||||||||||||||||
limitstr:MaxLength,Postfix | This function allows you to limit the output length of a string and to optionally add a postfix. If the string exceeds the MaxLength, it is shortened and the optional postfix is appended. Examples:
| ||||||||||||||||||||||||||||||||||||||||
splitlist:Split char,Index | This function splits the variable value at Split char into 1 to many elements and returns the element at the specified Index. Index can be first, last or a number >= 0. Examples: Variable contains: beach;sun;family;vacation
Variable contains: Motive|Vehicle|Car
This can be used together with the foreach formatting function to extract selected elements, e.g. of keywords: {File.MD.hierarchicalkeywords|foreach:{value|splitlist:|,last}, } returns the leaf (bottom-most) keyword of all keywords assigned to a file. | ||||||||||||||||||||||||||||||||||||||||
splicelist:Split char{,Prefix}{,Postfix}{,trimdupes} | This function splits the variable value at each of the provided split characters and then recombines them using the optional prefix and postfix literals. If trimdupes is provided, duplicates are removed.This variable can be very helpful if you work with hierarchical keywords and you want to flatten or transform them in any way. Examples:Variable contains two hierarchical keywords separated with a ; :location|beach|daytona;motive|portrait
Variable contains: Motive|Vehicle|Car
This can be used together with the foreach formatting function to extract selected elements, e.g. of keywords: {File.MD.hierarchicalkeywords|foreach:{value|splitlist:|,last}, } returns the leaf (bottom-most) keyword of all keywords assigned to a file. | ||||||||||||||||||||||||||||||||||||||||
filter:Regexp | This function allows you to filter the metadata tag value or Attribute value. The non case-sensitive regular expression is applied to the value. If the value does not match the regular expression, the value is returned as an empty string. If this is a multi-value metadata tag (e.g., keywords) or an Attribute, each value is matched separately against the regular expression. This means you can restrict the output of variables to certain values. Examples:
You can combine the filter: function with many other functions. Not only count but also is, length or hasvalue. This opens many possibilities for applying this function. | ||||||||||||||||||||||||||||||||||||||||
replace:This==That | This function allows you to replace text. You can add multiple replace: arguments if needed. You can use a variable for the That text. Special Tokens: For some situations you may need to replace special non-printable characters like carriage return or line feed. For this purpose, IMatch supports the following tokens:
Examples:
| ||||||||||||||||||||||||||||||||||||||||
replacefirst:This==That | Replaces the first occurrence of This with That. | ||||||||||||||||||||||||||||||||||||||||
replacelast:This==That | Replaces the last occurrence of This with That. | ||||||||||||||||||||||||||||||||||||||||
pereplace:This==That | This function is a variation of the replace function above. The difference is that this replace function does not escape potentially unsafe characters like < or &. You can use this replace variant if you want to add XAML or HTML contents. Pereplace works on already escaped text, after IMatch has replaced unsupported characters like & with their corresponding escape codes, e.g. & for & or lt; for < If you use this replace function, IMatch has no control over the result and invalid XAML code may break the formatting or cause unwanted side effects. Make sure that only valid XMAL code is used as on the replacement side. Special Tokens: For some situations you may need to replace special non-printable characters like carriage return or line feed. For this purpose, IMatch supports the following tokens:
Examples:
Example: Your input text is: The name of the town is D'Hanis Since ' has a special meaning in XML/HTML IMatch has to escape it with the corresponding escape sequence: The name of the town is D'Hanis This text is now the input for your pereplace statement. No problem so far. But if you now replace ; with something else, you won't get what you expect: pereplace:~;==<LineBreak/> results in The name of the town is D&apos<LineBreak>Hanis which is not what you want, clearly. If you find yourself in the situation where you a) have to process text for XML/HTML which may contain escape sequences like ' or lt; and you want to pereplace ; with something else, you must ensure that the text does not contain escape codes before it reaches pereplace. For the case used here, you should add a replace:'==´ at the very beginning (before pereplace). This will replace all ' in the original text with the very similar ´ character. This prevents IMatch from inserting ' into the text and the pereplace does not produce unwanted side effects. Phew! Sorry for this but it had to be said. ;-) | ||||||||||||||||||||||||||||||||||||||||
escape:boolean | This function escapes characters unsafe for XML usage. This means characters like < or > in the variable which are not allowed in XML are replaced with their corresponding escape codes. Use this function if you want to write out variables to an XML document or web service. If you use this with false as the value, the method only escapes unsafe characters. If you use true as the value, the method also converts carriage-return and linefeed into the XAML <LineBreak/> token. This allows you to wrap text in features which use XAML for formatting. IMatch already escapes variables in features which use XML or XAML (e.g. file window tip or slide show overlays or text export).
| ||||||||||||||||||||||||||||||||||||||||
htmlescape:boolean | Same as escape above, but for HTML. This method escapes characters unsafe for HTML usage and (if you set it to true) also converts carriage-return and linefeed into the HTML <br/> token. This allows you to add line breaks to HTML output. | ||||||||||||||||||||||||||||||||||||||||
to_upper | Converts the variable content into upper case (abc => ABC). This function has no parameters. Just append it to your variable expression. Examples: e.g.: {File.Name|to_upper} or {File.Name|substr:0,2;to_upper} | ||||||||||||||||||||||||||||||||||||||||
to_lower | Converts the variable content into lower case (AbC => abc). This function has no parameters. | ||||||||||||||||||||||||||||||||||||||||
capitalize | Converts the first letter into upper case (london => London). This function has no parameters. | ||||||||||||||||||||||||||||||||||||||||
reverse | Reverses the variable content (ABC => CBA). This function has no parameters. | ||||||||||||||||||||||||||||||||||||||||
trim:type | This method removes (trims) white-space characters from the string. It also removes new line, space, and tab characters. Possible values for type are:
| ||||||||||||||||||||||||||||||||||||||||
index:type | For variables with multiple values, e.g. categories, collections, persons, Attributes, keywords. This function allows you to access a specific element in the enumeration, e.g. the first or last keyword. Possible values for type are:
| ||||||||||||||||||||||||||||||||||||||||
limit:positive number | For variables with multiple values, e.g. categories, Attributes, keywords. This function allows you to limit the output to a specific number of elements. This can be very useful if you have many keywords or categories and you want to ensure that a layout, File Window Info Tip etc. does not exceed a certain size. Examples:
| ||||||||||||||||||||||||||||||||||||||||
sort:direction | For tag-based variables {File.MD.*} and Attributes {File.AT.*} with multiple values. Uses a text sort before returning the values. The sort is applied before index and limit. Possible values for direction are:
| ||||||||||||||||||||||||||||||||||||||||
foreach:expression | This is a very powerful function for variables with repeatable content (keywords, categories, persons, ...).
There are several special variables which are only valid when used together with
Examples:{File.MD.hierarchicalkeywords|foreach:[{value}]} Output the keywords of the file, wrapped in [] {File.Persons.Tag|foreach:-{value}} This outputs {File.Persons.Tag|foreach:-{value}⎵({index})⎵} This outputs {File.Persons.Tag|foreach:{value} ({File.Persons.Age.Years|index:{index}}) } This outputs {File.Persons.Tag|foreach:{value} This outputs Write all 3 lines shown above in one single line for your expression. We had to wrap it here for layout purposes. {File.MD.hierarchicalkeywords|foreach:{value|substr:{value|findreverse:|;math:add,1}},} This variable returns the leaf keywords. For a file with the keywords: | ||||||||||||||||||||||||||||||||||||||||
count:boolean | This function counts the elements in the given variable. Useful for all variables which return multiple values. e.g. categories, keywords, Attributes. The only useful value for the Boolean argument is true. Examples:
| ||||||||||||||||||||||||||||||||||||||||
sum:boolean | This function calculates the sum of the elements in the given variable. Used mostly with numerical Attributes of type Real or Int. Examples:
| ||||||||||||||||||||||||||||||||||||||||
avg:boolean | This function calculates the average of the elements in the given variable. Used mostly with numerical Attributes of type Real or Int. Examples:
| ||||||||||||||||||||||||||||||||||||||||
math:Op, Value {,Decimals} | This function performs mathematical operations on the variable. This is designed for variables with numerical values. Or you use one of the other formatting functions first to extract numerical data from the variable content. If the value of the variable cannot be converted into a valid number, it is treated as 0. Note: If this is not the first function used, you must use the cast function to ensure that the value of the variable is numeric, either real or int. If you use this as the first function (directly after the Use math as the first function after the Examples:
| ||||||||||||||||||||||||||||||||||||||||
cast:Type | This function is used to ensure a specific numerical format. See Casting Variables for more information. | ||||||||||||||||||||||||||||||||||||||||
numformat:Type, Width {,Decimals} | This function allows you to cast (convert) the contents of a variable into an int or float numerical data type, and to format the resulting number. This function is useful when you want to produce a specific number of digits from a numerical variable, e.g., in the Renamer or when using one of the export modules. This variable always works with the raw numerical value (if available and this function is the first variable function). This guarantees that you can access the full numeric precision available for a given tag. For example, if you work with floating point variables like EXIF shutter speed, you may get values like 0.00313 (1/320s). If this value is formatted using the standard user-specific numeric prevision (2 digits), it will be formatted as 0,00. If you use a numformat with a width of 1 and a precision of 5, you get five digits after the decimal point: 0.00313. Parameters:
Examples: Assumed text in variable: 7.26
Formatting EXIF sub-seconds: A good usage example for numformat is the EXIF sub-second metadata tag. If you want to use this, e.g., in the Renamer to produce a unique output file name, you usually want to produce output with two digits: {File.MD.Exif::Main\37520\SubSecTime\0|numformat:int,02} When you use the variable with this numformat, you get values like 02, 07, 14, 99. If the sub second value is less than 10, it will be prefixed with a zero. Roman and Hexadecimal Output The special width tokens roman and hex enable you to produce roman numerals or hexadecimal numbers. For a file with a rating of 4 {File.MD.XMP::xmp\Rating\Rating|numformat:int,roman}returns the value |
Metadata variables like {File.MD.XMP::photoshop\DateCreated\DateCreated\0} (Note: this is the Standard Tag Date Subject Created) are formatted in the standard ExifTool Format: YYYY:MM:DD hh:mm:ss, e.g. "2012:02:01 12:00:42". While this format is ideal for communication between IMatch, ExifTool and the metadata stored in your files, it is not the best for display or export purposes.
If you display metadata date and time values in file window tip, the slide show or export it to a text file, you usually want to use the default format for your country, or a specific format required by the export. Or you want to extract only the year or calendar week from date. All this can be achieved by using date and time formatting arguments.
Only date and time variables support these formatting arguments.
If you use them with a variable of a different type or the contents of the variable cannot be transformed into a valid date and time value, IMatch returns the unmodified contents of the variable.
Date Code | Description |
---|---|
M | Month as a number without leading zeros (1-12) |
MM | Month as a number with leading zeros (01-12) |
MMM | Month as an abbreviation (Jan - Dec) |
MMMM | Unabbreviated Month (January - December) |
D | Day without leading zeros (1-31) |
DD | Day with leading zeros (01-31) |
DDD | Week day as an abbreviation (Sun - Sat) |
DDDD | Unabbreviated week day (Sunday - Saturday) |
YY | Year as a two-digit number (for example, 12) |
YYYY | Year as a four-digit number (for example, 2012) |
Time Code | Description |
h | Hours as a number without leading zeros (0-23) |
hh | Hours as a number with leading zeros (00-23) |
hhh | Hours as a number without leading zeros (0-12) 12hr format |
hhhh | Hours as a number with leading zeros (00-12) 12hr format |
m | Minutes as a number without leading zeros (0-59) |
mm | Minutes as a number with leading zeros (00-59) |
s | Seconds as a number without leading zeros (0-59) |
ss | Seconds as a number with leading zeros (00-59) |
t | The A.M. / P.M. indicator (if enabled and set for the current locale). |
Special Codes | |
XLD | Date representation for the current locale 24.12.2011 |
XLDL | Long Date representation for the current locale Saturday, 24. December 2011 |
XLT | Time representation for the current locale 12.00.00 |
XWD | Weekday Name |
XWDS | Short Weekday Name |
XDOY | Day of Year (Day of year as decimal number (001 – 366)) |
XWOYS | Week of year as decimal number, with Sunday as first day of week (1 – 54) |
XWOYM | Week of year as decimal number, with Monday as first day of week (1 – 54) |
You can mix these special tokens with normal text to separate the individual parts of your date or to create custom formats. For example:
{File.DateTime|format:XLD} => 24.12.2011 {File.DateTime|format:YYYY-MM-DD} => 2011-12-24 {File.DateTime|format:YYYY/MM/DD} => 2011/12/24 {File.DateTime|format:hh.mm.ss} => 12.11.42
The semicolon ; is used to separate multiple formatting arguments and cannot be used as literal text. If your text contains a ; you must escape it with a ~, as in ~;
{File.DateTime} | This File variable uses the short date and time format for the current locale (as configured in the Windows control panel) unless you change it via a formatting argument.24.12.2011 12:01:53 |
{File.DateTime|format:YYYY} | 2011 |
{File.DateTime|format:YY} | 11 |
Week {File.DateTime|format:XWOYS} | Week 51 |
{File.DateTime|format:YYYYMMDD} | 20111224 |
{File.DateTime|format:YYYY-MM-DD | 2011-12-24 |
Metadata Date and Time Variables | |
---|---|
{File.MD.XMP::photoshop\DateCreated\DateCreated\0} | This File variable uses the standard ExifTool format2011:12:24 12:01:53 |
{File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:YYYY} | 2011 |
{File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:XLD} | 24.12.2011 |
{File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:XLDL}- {File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:XLT} | Saturday, 24. December-2011 12:01:53 |
{File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:MM}/ {File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:YYYY} | 12/2011 |
To get the raw metadata value for a date/time tag, you can use the value:rawfrm function, e.g. {File.MD.XMP::photoshop\DateCreated\DateCreated|value:rawfrm}
Most features for which you can use variables also support custom formatting. See the corresponding topic for more information.