Skip to Content
User GuideVariables and Filters

Variables and Filters

Variables let you inject metadata into rule inputs and compose templates. Filters transform variable output before it is inserted.

In variable-enabled text fields, SmartRenamer also shows quick tokens for common syntax such as {, |, :, and } so you can build templates faster on touch devices.

Variable Catalog

VariableCategoryOutput
{name}FileOriginal filename without extension
{ext}FileFile extension only
{parent}FileImmediate parent folder name
{date_created}DateFile creation date
{date_modified}DateFile modification date
{size}SizeFile size in bytes
{size_kb}SizeFile size in KB
{size_mb}SizeFile size in MB
{date_now}DateCurrent date/time
{uuid}UniqueRandom unique identifier
{hash}UniqueFile content hash (MD5 by default)
{photo_date}PhotoDate the photo was taken
{photo_title}PhotoTitle embedded in the photo
{photo_artist}PhotoPhotographer or artist
{photo_copyright}PhotoCopyright text
{photo_software}PhotoSoftware that created or edited the photo
{photo_keywords}PhotoKeywords embedded in the photo
{image_width}ImageWidth in pixels (photos and videos)
{image_height}ImageHeight in pixels (photos and videos)
{orientation}Imagelandscape, portrait or square, taking rotation into account
{camera_make}CameraCamera manufacturer
{camera_model}CameraCamera model
{lens_model}CameraLens model
{focal_length}ExposureFocal length in mm
{focal_length_35mm}Exposure35 mm equivalent focal length
{aperture}ExposureAperture (f-number)
{shutter_speed}ExposureShutter speed, for example 1-250 for 1/250 s
{iso}ExposureISO sensitivity
{flash}Exposureon or off
{gps_latitude}LocationLatitude (south is negative)
{gps_longitude}LocationLongitude (west is negative)
{gps_altitude}LocationAltitude in metres (below sea level is negative)
{place_city}LocationCity of the photo’s GPS position (online lookup)
{place_region}LocationState or province (online lookup)
{place_country}LocationCountry name (online lookup)
{place_country_code}LocationCountry code, for example PT (online lookup)
{duration}MediaLength of audio or video, mm-ss or h-mm-ss
{media_date}MediaCreation date of an audio, video or PDF file
{media_title}MediaTitle
{media_artist}MediaArtist (the author for a PDF)
{media_album}MediaAlbum name
{media_genre}MediaGenre
{media_track}MediaTrack number
{media_year}MediaYear
{page_count}DocumentNumber of pages in a PDF

Metadata variables read data embedded in the file. A value that the file does not have resolves to empty text, so combine them with the default filter, for example {media_title | default: Unknown}.

Variable picker and syntax guide

Base Syntax

Simple variable

{name}

Variable with format

{date_created:yyyy-MM-dd}

Variable with filters

{name | upper | truncate: 10}

Combined

{parent | lower}_{name}_{date_modified:yyyyMMdd}

Format Rules by Variable

Date variables

Applies to:

  • date_created
  • date_modified
  • date_now

Examples:

  • {date_created:yyyy-MM-dd} -> 2026-02-27
  • {date_modified:HH-mm-ss} -> 14-30-45
  • {date_now:yyyyMMdd_HHmm} -> 20260227_1430

Common tokens:

  • yyyy year
  • MM month
  • dd day
  • HH hour (24h)
  • mm minute
  • ss second
  • EEEE weekday name

Photo and media dates

{photo_date} and {media_date} accept the same date formats as the other date variables, plus SSS for milliseconds when the camera records them.

  • {photo_date:yyyy-MM-dd_HHmmss} -> 2026-06-15_120000
  • {photo_date:HHmmss_SSS} -> 120000_123 (keeps burst shots apart)

File names cannot contain /, so a format such as dd/MM/yyyy is rejected. Use dd.MM.yyyy or ddMMyyyy.

Duration and shutter speed

File names cannot contain / or :, so these values use hyphens:

  • {shutter_speed} writes 1/250 s as 1-250.
  • {duration} is mm-ss (for example 03-25), or h-mm-ss from one hour up.
  • {duration:seconds} gives the total number of seconds, for example 205.

Place names

{place_city}, {place_region}, {place_country} and {place_country_code} are filled from the photo’s GPS position. They are off by default. Turn on Settings -> Place Names -> Look up place names online to use them.

  • With the switch off, these variables are empty and nothing leaves the device.
  • With the switch on, the photo’s coordinates (rounded to about 1 km) are sent to Apple’s location service, one lookup at a time, and cached for the session.
  • The preview shows empty text first and fills in as places arrive. Names come back in the device language.
  • Lookups that fail because the device is offline or rate-limited are retried later.
  • Photos without a GPS position stay empty. Use {place_city | default: Unknown}.
  • The setting syncs across devices when iCloud sync is on.

Parent depth format

parent supports depth as numeric format:

  • {parent} -> immediate parent (depth 1)
  • {parent:2} -> grandparent
  • {parent:3} -> three levels up

UUID format

General variable usage (outside Compose):

  • {uuid} -> 32 hex chars (no hyphens)
  • {uuid:8} -> first 8 chars

Compose usage differs (Compose uuid block defaults to 36 chars with hyphens). See Compose Rule (Visual Block Editor).

Hash format

  • {hash} -> MD5, 8 chars
  • {hash:md5:16} -> MD5, 16 chars
  • {hash:sha256:16} -> SHA256, 16 chars

Filter Grammar

Supported filters:

  • upper
  • lower
  • title
  • truncate:<length>
  • substring:<start>,<length>
  • regexp:<pattern>,<group>
  • replace:<old>,<new>
  • default:<value>

Examples:

  • {name | upper} -> REPORT
  • {name | lower} -> report
  • {name | title} -> Quarterly Report
  • {name | truncate: 8} -> first 8 chars
  • {name | substring: -3} -> last 3 chars
  • {name | substring: 10, 3} -> 3 chars starting from position 10
  • {name | regexp: (\w+)$} -> extracts the last word
  • {name | regexp: (\d+)\. .+ (\w+), 2} -> extracts the second capture group
  • {name | replace: _, -} -> replace _ with -
  • {ext | default: txt} -> fallback when extension is empty

Filter chaining is left-to-right:

{name | replace: _, - | upper | truncate: 12}

Escaping Rules

Use backslash escapes when you need literal syntax characters.

  • \{ -> literal {
  • \} -> literal }
  • \| -> literal |
  • \\ -> literal \

Examples:

  • \{name} -> literal {name}
  • prefix_\{_{name} -> prefix_{_myfile

Where Variables Are Supported

AreaVariables supported
Prefix textYes
Suffix textYes
Insert textYes
Search and Replace replacement fieldYes
Search and Replace find/pattern fieldNo
Replace Whole Name templateYes
Set Extension fieldYes
Sequence prefix/suffix (replace mode)Yes
Compose Text ModeYes
Compose Variable blockYes

Notes:

  • Compose Visual Mode has dedicated blocks for date_now, uuid, hash, and parent-depth behavior.
  • Variable-enabled text inputs can show quick syntax tokens to speed up template entry.
  • Unknown variables are left as literal placeholder text (for example {unknown}) instead of silently removed.

Compose Named-Attribute Syntax (Advanced)

Compose also supports named attributes for standard variables:

{name filter="upper|truncate: 10"} {date_created format="yyyy-MM-dd"} {name replace="_,-" default="untitled"}

This is equivalent to short + pipe style but often easier to read in long templates.

Practical Examples

Example 1: Date-stamped report

{date_now:yyyyMMdd}_{name | lower | replace: ,_}

Result:

  • 20260227_quarterly_report

Example 2: Parent + file + size

{parent | lower}_{name}_{size_kb}kb.{ext | upper}

Result:

  • documents_report_42.5kb.PDF

Example 3: Hash fallback naming

{name | default: untitled}_{hash:sha256:12}

Result:

  • untitled_a3f1c778d0ef

Example 4: Photo by capture date and camera

Template:

  • {photo_date:yyyy-MM-dd_HHmmss}_{camera_model}

Result:

  • 2026-06-15_120000_iPhone 17 Pro.jpg

Example 5: Song by track, artist and title

Template:

  • {media_track} - {media_artist} - {media_title | default: Unknown}

Result:

  • 04 - Example Artist - Example Song.m4a

Example 6: PDF by title and page count

Template:

  • {media_title} ({page_count} pages)

Result:

  • Annual Report (12 pages).pdf

Example 7: Photo with city

Template:

  • {photo_date:yyyy-MM-dd}_{place_city | default: Unknown}_{name}

Result:

  • 2026-06-15_Lisbon_IMG_0042.jpg

Requires Look up place names online in Settings.

Debugging Tips

  1. Variable resolves empty:
  • the file may have no embedded data (screenshots and exported images often lose it), the file type may be unsupported, or the value may be empty. Try {name} and {ext} first, and add a default filter.
  • for {place_*} variables, check that Look up place names online is on and the photo has a GPS position.
  1. Date format looks wrong:
  • test with yyyy-MM-dd first, then add complexity.
  1. Replace filter not behaving:
  • ensure two arguments are provided: replace: old,new.
  1. Unexpected literal output:
  • check for typo in variable name or missing closing brace.
  1. Collisions in output:
  • include name, sequence, uuid, or hash in your pattern.
Last updated on