Tag modifiers
New in version 4.14
Tag modifiers are extra parameters that can be added to tags to modify their results. Some modifiers take extra parameters to control their behavior.
This is an example of how a modifier can be used to make the result of the <Artist>
tag uppercase:
<Artist:upper>
Here is an example taking additional parameters:
<Artist:substr:1:10>
You can also use tag modifiers with tags that already takes parameters, like below. You cannot add additional tag parameters after the modifier or the modifier parameters.
<Exiftool:encoding:upper>
You can even use multiple modifiers on a single tag, like this:
<Artist:substr:1:10:upper>
It is also possible to use the same modifier multiple times on a single tag, like this:
<Artist:alt:Performer:alt:Singer:default:No artist>
Note, tag modifiers, with the exception of the default
and alt
modifier, are not applied to empty values.
Available modifiers
default:text |
If the result of the tag is empty, this modifier will return the specified default value instead. Can be used to provide fallback values for tags that may not always have a value. Example: <Artist:default:Unknown Artist> will return "Unknown Artist" if the value of the <Artist> tag is empty. |
alt:tagname |
Similar to the default modifier, but it will return the value of the specified tag if the current tag is empty. This is useful for providing a fallback value from another tag.Example: <Title:alt:Subject> will return the value of the <Subject> tag if the <Title> tag is empty. Can also be combined with the default modifier: <Title:alt:Subject:default:Unknown Title> If parameters for the tag is used, they must be specified for each tag in the chain, like this: <Img Month:Xxxx:alt:Month Modified:Xxxx> |
append:text |
Appends the specified text to the tag's value. Note: If the value of the tag is empty, this modifier does nothing. Example: <Duration:append: seconds> will append the text " seconds" to the value of the <Duration> tag. |
prepend:text |
Prepends the specified text to the tag's value. Note: If the value of the tag is empty, this modifier does nothing. Example: <Duration:prepend:Duration > will prepend the text "Duration " to the value of the <Duration> tag. |
suffix:text |
Works like append, with the only difference being that suffix only appends the text if the value of the tag doesn't already ends with the text. Example: <Duration:suffix: seconds> will append the text " seconds" to the value of the <Duration> tag, but only if it doesn't already end with " seconds". |
prefix:text |
Works like prepend, with the only difference being that prefix only prepends the text if the value of the tag doesn't already starts with the text. Example: <Duration:prefix:Duration > will prepend the text "Duration " to the value of the <Duration> tag, but only if it doesn't already start with "Duration ". |
pad:length:character |
Adds padding to the tag's value. Takes two additional parameters: the total length of the resulting string and optionally the character to use for padding. If the tag's value is already longer than the specified length, this modifier does nothing. Example: <Duration Sec:pad:4:0> will pad the value of the <Duration Sec> tag with zeros on the left until it is 4 characters long. |
trim |
Trims whitespace from the start and end of the tag's value. This modifier does not take any parameters. Example: <Artist:trim> will remove any leading and trailing whitespace from the value of the <Artist> tag. |
upper:pos:count |
Converts the tag's value to uppercase. Example: <Artist:upper> will convert the value of the <Artist> tag to uppercase.Use the optional parameters to specify a position and count of characters to convert to uppercase. For example, <Artist:upper:1:5> will convert the first 5 characters of the value of the <Artist> tag to uppercase. |
lower:pos:count |
Converts the tag's value to lowercase. Example: <Artist:lower> will convert the value of the <Artist> tag to lowercase.Use the optional parameters to specify a position and count of characters to convert to lowercase. For example, <Artist:lower:1:5> will convert the first 5 characters of the value of the <Artist> tag to lowercase. |
titlecase:pos:count |
Converts the tag's value to title case. This means that the first character of each word will be capitalized, except for certain small words, and all other characters will be lowercase. See New Case method for a description of how the title case works. Example: <Artist:titlecase> will convert the value of the <Artist> tag to title case. |
substr:pos:count |
Extracts a substring from the tag's value. Takes two additional parameters: the position index and the length. This tag works like the <Substr> tag, which means it also supports text as parameters. When pos is a text instead of a number, it will find the index of the text at the position. Wild cards and regular expressions are not supported.Example: <Artist:substr:1:10> will extract a substring starting at index 1 with a length of 10 characters from the value of the <Artist> tag. |
rsubstr:pos:count |
Extracts a substring from the tag's value, starting from the end. Takes two additional parameters: the position index (from the end) and the length. Example: <Artist:rsubstr:1:10> will extract a substring starting at index 1 from the end with a length of 10 characters from
|
insert:text:pos |
Inserts a substring into the tag's value. Takes two additional parameters: the text to insert and the position index. Example: <Artist:insert:NewText:5> will insert NewText at index 5 in the value of the <Artist> tag. |
remove:pos:count |
Removes a substring from the tag's value. Takes two additional parameters: the start index and the length. As with the Remove method using the Position remove type, the parameters can be text patterns. Example: <Artist:remove:1:10> will remove a substring starting at index 1 with a length of 10 characters from the value of the <Artist> tag. |
replace:replace:with |
Replaces a substring in the tag's value. Takes two additional parameters: the text to replace and the replacement text. Example: <Artist:replace:old:new> will replace all occurrences of old with new in the value of the <Artist> tag. |
word:index:count |
Extracts a specific word from the tag's value. Works the same as the <Word> tag. Example: <Artist:word:2> will extract the second word from the value of the <Artist> tag. If you want to extract multiple words, you can use the count parameter, like this:
<Artist:word:2:3> will extract the second, third, and fourth words from the value of the <Artist> tag. |
add:number |
If the result of the tag is numeric, this modifier will add the number specified by the parameter to the tag's value. If the tag's value is not numeric, this modifier does nothing. Example: <Img Hour:add:5> will add 5 to the value of the <Img Hour> tag if it is numeric. |
subtract:number |
If the result of the tag is numeric, this modifier will subtract the number specified by the parameter from the tag's value. If the tag's value is not numeric, this modifier does nothing. Example: <Img Hour:subtract:5> will subtract 5 from the value of the <Img Hour> tag if it is numeric. |