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
| Variable | Category | Output |
|---|---|---|
{name} | File | Original filename without extension |
{ext} | File | File extension only |
{parent} | File | Immediate parent folder name |
{date_created} | Date | File creation date |
{date_modified} | Date | File modification date |
{size} | Size | File size in bytes |
{size_kb} | Size | File size in KB |
{size_mb} | Size | File size in MB |
{date_now} | Date | Current date/time |
{uuid} | Unique | Random unique identifier |
{hash} | Unique | File content hash (MD5 by default) |
{photo_date} | Photo | Date the photo was taken |
{photo_title} | Photo | Title embedded in the photo |
{photo_artist} | Photo | Photographer or artist |
{photo_copyright} | Photo | Copyright text |
{photo_software} | Photo | Software that created or edited the photo |
{photo_keywords} | Photo | Keywords embedded in the photo |
{image_width} | Image | Width in pixels (photos and videos) |
{image_height} | Image | Height in pixels (photos and videos) |
{orientation} | Image | landscape, portrait or square, taking rotation into account |
{camera_make} | Camera | Camera manufacturer |
{camera_model} | Camera | Camera model |
{lens_model} | Camera | Lens model |
{focal_length} | Exposure | Focal length in mm |
{focal_length_35mm} | Exposure | 35 mm equivalent focal length |
{aperture} | Exposure | Aperture (f-number) |
{shutter_speed} | Exposure | Shutter speed, for example 1-250 for 1/250 s |
{iso} | Exposure | ISO sensitivity |
{flash} | Exposure | on or off |
{gps_latitude} | Location | Latitude (south is negative) |
{gps_longitude} | Location | Longitude (west is negative) |
{gps_altitude} | Location | Altitude in metres (below sea level is negative) |
{place_city} | Location | City of the photo’s GPS position (online lookup) |
{place_region} | Location | State or province (online lookup) |
{place_country} | Location | Country name (online lookup) |
{place_country_code} | Location | Country code, for example PT (online lookup) |
{duration} | Media | Length of audio or video, mm-ss or h-mm-ss |
{media_date} | Media | Creation date of an audio, video or PDF file |
{media_title} | Media | Title |
{media_artist} | Media | Artist (the author for a PDF) |
{media_album} | Media | Album name |
{media_genre} | Media | Genre |
{media_track} | Media | Track number |
{media_year} | Media | Year |
{page_count} | Document | Number 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}.
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_createddate_modifieddate_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:
yyyyyearMMmonthdddayHHhour (24h)mmminutesssecondEEEEweekday 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 as1-250.{duration}ismm-ss(for example03-25), orh-mm-ssfrom one hour up.{duration:seconds}gives the total number of seconds, for example205.
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:
upperlowertitletruncate:<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
| Area | Variables supported |
|---|---|
| Prefix text | Yes |
| Suffix text | Yes |
| Insert text | Yes |
| Search and Replace replacement field | Yes |
| Search and Replace find/pattern field | No |
| Replace Whole Name template | Yes |
| Set Extension field | Yes |
| Sequence prefix/suffix (replace mode) | Yes |
| Compose Text Mode | Yes |
| Compose Variable block | Yes |
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
- 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 adefaultfilter. - for
{place_*}variables, check that Look up place names online is on and the photo has a GPS position.
- Date format looks wrong:
- test with
yyyy-MM-ddfirst, then add complexity.
- Replace filter not behaving:
- ensure two arguments are provided:
replace: old,new.
- Unexpected literal output:
- check for typo in variable name or missing closing brace.
- Collisions in output:
- include
name,sequence,uuid, orhashin your pattern.