Source: https://www.advancedrenamer.com/technical/aren-format/README.md # Advanced Renamer .aren format for LLMs Technical reference for LLMs generating `.aren` JSON files. Every generated file uses `"type": "project"`. - [Generation contract](https://www.advancedrenamer.com/technical/aren-format) - [Fields and JSON types](https://www.advancedrenamer.com/technical/aren-format/format-reference) - [Tag strings](https://www.advancedrenamer.com/technical/aren-format/tags-and-patterns) - [Regex strings and escaping](https://www.advancedrenamer.com/technical/aren-format/regex-reference) - [Worked examples: requests, complete files, and expected results](https://www.advancedrenamer.com/technical/aren-format/examples) - [JSON Schema](https://www.advancedrenamer.com/technical/aren-format/aren-project.schema.json) Format target: Advanced Renamer 4.29. Revision: 6 November 2026. Earlier-version compatibility is unspecified. Application usage and feature behavior are documented in the [user guide](https://www.advancedrenamer.com/user_guide/gettingstarted) and its subpages. --- Source: https://www.advancedrenamer.com/technical/aren-format/index.md # Advanced Renamer .aren generation contract This technical reference is for LLMs generating `.aren` files. Format target: Advanced Renamer 4.29; revision: 6 November 2026. Earlier-version compatibility is unspecified. Application usage and feature behavior belong to the [user guide](https://www.advancedrenamer.com/user_guide/gettingstarted) and its subpages. ## File encoding and root object Emit UTF-8 JSON containing one object. The root `type` is always `"project"`. Use exact property names and lowercase identifiers from the [field reference](https://www.advancedrenamer.com/technical/aren-format/format-reference). Include no comments, Markdown fences, or explanatory text inside the file. ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "_", "replacewith": " ", "casesensitive": false, "regularexpressions": false, "occurrence": 0 } ] } ``` ## Generation constraints - Include all six root properties shown above. Rename requires at least one active method. Move/copy requires a nonempty `outputfolder`; `methods: []` preserves filenames. - Methods appear in execution order. Include `methodname`, `active`, and `applyto` on every method. Timestamp has a separate `applyto` vocabulary. - Preserve JSON types. Positional fields such as Add's `position` are strings; Renumber's `numberposition` is an integer. List's `newnames` is a string; List Replace's `replace` and `replacewith` are arrays of strings. - Use `applyto: "name"` to preserve the current extension. Do not append an extension to a mask selecting only the basename. - Encode [tags](https://www.advancedrenamer.com/technical/aren-format/tags-and-patterns), [regexes, and scripts](https://www.advancedrenamer.com/technical/aren-format/regex-reference) as JSON strings. Escape backslashes, double quotes, and line breaks at the JSON layer. - Use only documented fields. Omit application identity, build identifiers, UI state, and project data outside this reference. - Resolve missing transformation details using the user guide or clarification. Do not invent fields, tags, metadata identifiers, or script APIs. - Identify any required item order, metadata, or application settings alongside the generated file. This format does not select or sort input items. The [JSON Schema](https://www.advancedrenamer.com/technical/aren-format/aren-project.schema.json) validates this authoring profile. It does not establish tag, regex, calendar date, filename, or transformation validity. See [worked examples](https://www.advancedrenamer.com/technical/aren-format/examples) for requests, complete files, and expected results. --- Source: https://www.advancedrenamer.com/technical/aren-format/format-reference.md # Advanced Renamer .aren JSON project format reference This reference describes reusable JSON `.aren` projects accepted by the Advanced Renamer **4.29**. For an introduction and a complete file, see [Generate Advanced Renamer .aren files](https://www.advancedrenamer.com/technical/aren-format). For complete task examples, see [worked examples](https://www.advancedrenamer.com/technical/aren-format/examples). ## File representation Use UTF-8 JSON with one root object. JSON property names are case-sensitive. Use the lowercase identifiers shown here. No comments, trailing commas, Markdown fences, or executable wrapper belong in an `.aren` file. The recommended authoring profile requires `type`, `batchmode`, `pairrename`, `foldermode`, `namecollision.rule`, and a `methods` array, even though the application can load files with fewer fields. For `batchmode: "rename"`, include at least one active method. For `move` or `copy`, `methods: []` is valid when filenames should stay unchanged; supply the destination in `outputfolder`. This makes generated intent explicit. Each method includes `methodname` and `active`; text methods also include `applyto`. The [companion JSON Schema](https://www.advancedrenamer.com/technical/aren-format/aren-project.schema.json) checks this authoring profile. It intentionally rejects unknown fields rather than covering every historical or full-project file the application can load. It does not prove regex validity, tag validity, filename validity, or the intended transformation. Optional application-saved fields `program`, `version`, and `tagpage`, described below, are outside that schema; omit them in schema-validated generated files. ## Root properties | Property | JSON type | Meaning / loading behavior | | --- | --- | --- | | `type` | string | Required. Always use `"project"`. | | `batchmode` | string | Required. `"rename"`, `"move"`, or `"copy"`. Specify explicitly. | | `pairrename` | boolean | Pair renaming. Prefer `false` enable only when the user intends paired-file behavior. | | `namecollision.rule` | string | Collision rule identifier; use `"fail"` for a routine project. | | `namecollision.separator` | string | Separator for collision rules that append text; defaults to `"_"`. | | `namecollision.pattern` | string | Pattern for `append_pattern` or `newname` collision rules; defaults to `""`. | | `namecollision.startvalue` | string | Start value for collision rule `append_number` or `append_character`; defaults to `""`. Use an explicit suitable value when choosing those rules. | | `outputfolder` | string | Destination folder mask for move/copy mode. Use a real destination appropriate to the user's OS; supports tags. Omit when batchmode is `"rename"`. | | `foldermode` | boolean | Required. `false` processes files; `true` processes folders. Copying folders is unsupported. | | `program` | string | Optional application identity, written by the application. Generated projects can omit it. | | `version` | integer | Optional application build identifier, not a schema version. Generated projects can omit it. The writer encodes major × 1,000,000 + minor × 10,000 + release × 100 + build; 4.29.0.0 is `4290000`. | | `methods` | array of objects | Methods to execute in order. For rename, include at least one active method. For move/copy without renaming, use `[]`. | The collision property names contain literal dots. For example, `"namecollision.rule": "fail"` is correct. A nested `"namecollision": {"rule": "fail"}` object is not the same setting. ### Collision rules | Identifier | Purpose | Relevant additional properties | | --- | --- | --- | | `fail` | Report collisions rather than resolving them by altering the names. | None. | | `ignore` | Ignore later items that collide with an earlier batch destination. | None. | | `append_number` | Append a number to resolve duplicate destinations. | `namecollision.separator`, `namecollision.startvalue`, e.g. `"1"`. | | `append_character` | Append an alphabetic sequence. | `namecollision.separator`, `namecollision.startvalue`, e.g. `"A"`. | | `append_imgsubsec` | Append image subseconds. | `namecollision.separator`; needs metadata. | | `append_pattern` | Append a tag/text pattern before the extension. | `namecollision.separator`, `namecollision.pattern`. | | `newname` | Use a replacement basename mask for collision resolution, retaining the extension. | `namecollision.pattern`. | ## Common method properties | Property | JSON type | Default when omitted | Meaning | | --- | --- | --- | --- | | `methodname` | string | No usable default | Exact method identifier from the sections below. | | `active` | boolean | `true` | Required. Execute this method. | | `description` | string | `""` | Optional method description. | | `condition` | object | No active condition | Optional per-item condition. | | `applyto` | string | Usually `"name"` | For text methods: `"name"`, `"extension"`, or `"nameandextension"`. Timestamp uses a different vocabulary. | `name` means the basename without the final extension and preserves the **current** extension. `extension` selects the extension without its leading dot. `nameandextension` selects the full filename. In method tables below, “default” means the JSON loading default, including fallback applied after reading an empty string. ## New Name — `newname` Replaces the whole name with a mask containing text and tags. | Property | Type | Default | Meaning | | --- | --- | --- | --- | | `mask` | string | `""` | New-name mask, e.g. `"Photo_"`. Empty mask leaves the name unchanged. | Use `applyto: "name"` to keep the current extension. Do not add `.` to such a mask unless a duplicate extension is intended. ## Replace — `replace` Replaces matches in the selected portion of the current name. | Property | Type | Default | Meaning | | --- | --- | --- | --- | | `replace` | string | `""` | Search text, wildcard/pattern list, or regular expression. | | `replacewith` | string | `""` | Replacement text; supports tags and, in regex mode, capture references such as `$1`. | | `casesensitive` | boolean | `false` | Case-sensitive matching. | | `regularexpressions` | boolean | `false` | Interpret the search as a regular expression. | | `occurrence` | integer | `0` | `0` replaces all matches; a positive value chooses an occurrence. | In non-regex mode, `/` and `\` separate patterns, and `*` can enable wildcard behavior. ## Add — `add` Inserts text in the selected portion of the current name. | Property | Type | Default | Meaning | | --- | --- | --- | --- | | `add` | string | `""` | Text or tag mask to insert. | | `position` | string | `"1"` | Insertion position. | | `backwards` | boolean | `false` | Resolve positions from the end. | | `regularexpressions` | boolean | `false` | Use regular expressions when resolving a position pattern. | Prefix: `position: "1", backwards: false`. Suffix: `position: "0", backwards: true`. When `applyto` is `name`, the suffix goes before the extension. ## New Case — `newcase` Changes capitalization of the selected portion of the current name. | Property | Type | Default | Allowed values / meaning | | --- | --- | --- | --- | | `newcasetype` | string | `"lower"` | Required. `lower`, `upper`, `inverse`, `title`. | | `newcaselocation` | string | `"all"` | Required. `all`, `firstletter`, `firstletter_word`, `pattern`, `position`. | | `pattern` | string | `""` | Match pattern when location is `pattern`. | | `regularexpressions` | boolean | `false` | Regex matching for location `pattern`. | | `posstart` | string | `""` | Start position when location is `position`; Use number in string for numeric value, `"1"`. | | `poscount` | string | `""` | Character count when location is `position`; Use number in string for numeric value, `"10"`. | | `applylowercasefirst` | boolean | `false` | Lowercase the selected name portion before applying the case change. Available only for `upper` or `title`, subject to the location rules below. | | `ignorewordsallcaps` | boolean | `false` | Preserve words already entirely in capitals. Available for `firstletter_word` with any case type, or `all` with `title`. | | `newcaselocation` | Case types allowing `applylowercasefirst` | Case types allowing `ignorewordsallcaps` | | --- | --- | --- | | `all` | `title` | `title` | | `firstletter` | `upper`, `title` | None | | `firstletter_word` | `upper`, `title` | `lower`, `upper`, `inverse`, `title` | | `pattern` | `upper`, `title` | None | | `position` | `upper`, `title` | None | For generated projects, omit an option or set it to `false` outside these combinations. Both options can be enabled together where both columns allow the chosen case type. With `applylowercasefirst`, lowercasing applies to the whole portion selected by `applyto` before the location-specific change; it is not limited to the matched pattern or position range. When both options are enabled, all-capital words are also preserved during that preliminary lowercasing. ## Remove — `remove` Removes characters by position, pattern, or character category. | Property | Type | Default | Allowed values / meaning | | --- | --- | --- | --- | | `removetype` | string | `"position"` | `position`, `pattern`, `diacritics`, `wordchars`, `nonwordchars`, `uppercase`, `lowercase`, `charlist`, `numbers`, `notnumbers`. | | `start` | string | `"1"` | Start position for positional removal. | | `count` | string | `"1"` | Count for positional removal. | | `pattern` | string | `""` | Pattern when `removetype` is `pattern`. | | `backwards` | boolean | `false` | Resolve positional removal from the end. | | `regularexpressions` | boolean | `false` | Regex matching when using a pattern. | | `casesensitive` | boolean | `false` | Case-sensitive matching where applicable. | | `charlist` | string | `""` | Characters for `charlist` removal. | | `charexceptions` | string | `""` | Character exceptions for supported category-removal modes. | | `location` | string | `"anywhere"` | `anywhere`, `start`, `end`. Applies only to `pattern`, `wordchars`, `nonwordchars`, `numbers`, and `notnumbers`; ignored for all other removal types. | ## Remove Pattern — `removepattern` *Deprecated*. The older separate pattern-removal method remains loadable. Use `remove` method type with `removetype: "pattern"` instead. | Property | Type | Default | Meaning | | --- | --- | --- | --- | | `pattern` | string | `""` | Pattern to remove. | | `casesensitive` | boolean | `false` | Case-sensitive matching. | | `regularexpressions` | boolean | `false` | Regex matching. | ## Trim — `trim` Removes selected characters from edges, or throughout the selected name portion. | Property | Type | Default | Allowed values / meaning | | --- | --- | --- | --- | | `characters` | string | `" .,_-"` | A set of characters, not a regex. | | `location` | string | `"start_and_end"` | `start_and_end`, `start`, `end`, `all`. | | `casesensitive` | boolean | `false` | Case-sensitive character comparison. | | `inversematch` | boolean | `false` | Invert the character selection. | `location: "all"` removes selected characters everywhere. Edge trimming preserves selected characters inside the untrimmed middle. ## Move — `move` Moves a segment **within a filename**. This is unrelated to batch mode `move`, which moves files to a destination folder. Prefer other methods when they can produce the same result. Use `move` when moving a character segment is needed and the alternatives do not express the transformation as clearly. | Property | Type | Default | Meaning | | --- | --- | --- | --- | | `movefrom` | string | `"1"` | Source position or position pattern. | | `movecount` | string | `"1"` | Segment length or count pattern. | | `moveto` | string | `"1"` | Destination position or position pattern. | | `relative` | boolean | `false` | Interpret the destination relative to the source, in modes supporting this. | | `backwards` | boolean | `false` | Resolve positions from the end. | | `regularexpressions` | boolean | `false` | Regex matching for position/count patterns. | ## Swap — `swap` Swaps the text before and after a separator in the selected name portion. | Property | Type | Default | Meaning | | --- | --- | --- | --- | | `separator` | string | `""` | Required. Exact separator. | | `occurrence` | integer | `1` | Required. Which separator occurrence to use, 1–10. | For example, separator `" - "` changes `Artist - Title.mp3` to `Title - Artist.mp3` with `applyto: "name"`. ## Renumber — `renumber` Changes an existing numeric sequence. To introduce a new counter into a name, use `newname` or `add` with an increment tag instead. | Property | Type | Default | Allowed values / meaning | | --- | --- | --- | --- | | `numberposition` | integer | `1` | Which numeric sequence in the selected portion to change, counting from 1. | | `change` | string | `"absolute"` | `absolute` assigns a sequence by list position; `relative` adds to the existing number. | | `newnumber` | integer | `1` | Starting value for absolute renumbering. | | `numberdifference` | integer | `1` | Amount added for relative renumbering; can be negative. | | `skip` | integer | `1` | Step for absolute renumbering. | | `zeropad` | string | `"auto"` | `auto`, `manual`, `no`. | | `numberlength` | integer | `3` | Minimum number length with manual padding. | | `negativenumbers` | boolean | `false` | Recognize a preceding minus sign as part of a number. | Names without the chosen numeric sequence are unchanged. List order affects absolute renumbering. Renumber uses JSON **integers**, unlike Add/Remove position fields. Renumber can also change the zero padding of existing numbers without changing their numeric values. Set `change: "relative"`, `numberdifference: 0`, `zeropad: "manual"`, and `numberlength` to the desired minimum number length (`NEW_LENGTH`). For example, `numberlength: 4` changes `image_7.jpg` to `image_0007.jpg`. ## List — `list` Assigns one replacement name per item in list order. | Property | Type | Default | Meaning | | --- | --- | --- | --- | | `newnames` | string | `""` | Newline-separated names, e.g. `"First\nSecond\nThird"`. It is a string, not a JSON array. | ## List Replace — `listreplace` Applies multiple replacement rows to each selected item, in row order. | Property | Type | Default | Meaning | | --- | --- | --- | --- | | `replace` | array of strings | `[]` | Search patterns. Unlike `replace` in the single Replace method, this is an array. | | `replacewith` | array of strings | `[]` | Corresponding replacements. Use the same number of rows as `replace`. | | `casesensitive` | boolean | `false` | Case-sensitive matching. | | `regularexpressions` | boolean | `false` | Regex matching. | Rows run sequentially, so later rows see earlier replacements. ## Script — `script` Executes an Advanced Renamer JavaScript method. Use ordinary methods when they express the task clearly. | Property | Type | Default | Meaning | | --- | --- | --- | --- | | `script` | string | `"return item.newBasename;"` | Per-item JavaScript method body returning the new selected name portion. Empty input falls back to the default. | | `prescript` | string | `""` | Pre-batch JavaScript. | Keep the script inside a JSON string with quotes and newlines escaped. ## Timestamp — `timestamp` Changes **file timestamps**, not the text of the filename. Renaming a file from a date tag is usually a `newname` task instead. | Property | Type | Default | Allowed values / meaning | | --- | --- | --- | --- | | `applyto` | string | `""` (no targets) | One or more comma-separated targets: `created`, `accessed`, `modified`; e.g. `"created,modified"`. This is not a JSON array. | | `change` | string | `"absolute"` | `created`, `accessed`, `modified`, `image`, `absolute`, `relative`, `filenamepattern`, `dirnamepattern`, `now`, `metadata`. | | `year` | integer | `0` | Absolute year or relative year adjustment. | | `month` | integer | `0` | Absolute month or relative month adjustment. | | `day` | integer | `0` | Absolute day or relative day adjustment. | | `hour` | integer | `0` | Absolute hour or relative hour adjustment. | | `minute` | integer | `0` | Absolute minute or relative minute adjustment. | | `second` | integer | `0` | Absolute second or relative second adjustment. | | `pattern` | string | `"--"` | Date/time extraction pattern for pattern modes. Empty input also gets this default. | | `metadatafield` | string | `""` | Metadata field identifier for `change: "metadata"`. | For `absolute`, provide a valid complete date and time. For `relative`, supply integer offsets, can be negative and zero for unaffected units. `filenamepattern`/`dirnamepattern` extract date components from the source basename/folder name. Available `metadatafield` depends on items in the batch and their metadata. ## Per-item conditions A condition selects which items a method changes. Put it inside that method, not at the root. The List, Script, and Timestamp do not support this common condition object; omit it on those methods. ```json { "active": true, "field": "ext", "match": "equals", "pattern": "jpg/jpeg", "notmatching": false } ``` This condition selects original extensions `jpg` or `jpeg`, ignoring case. Extension condition values omit the leading dot. | Property | Type | Default | Allowed values / meaning | | --- | --- | --- | --- | | `active` | boolean | `false` | Must be `true` to enable the condition. This default differs from method `active`. | | `field` | string | `"name"` | `name`, `newname`, `ext`, `newext`, `path`, `pathandname`, `newpathandname`, `metadata`. | | `match` | string | `"contains"` | `contains`, `startswith`, `endswith`, `equals`, `regex`, `lengthshorter`, `lengthlonger`. | | `pattern` | string | `""` | Search expression, alternatives, regex, or decimal length threshold. Empty pattern does not filter items. | | `notmatching` | boolean | `false` | Invert a nonempty active condition. | | `metadatafield` | string | `""` | Required for field `metadata`. | Conditions use case-insensitive matching. For `contains`, `startswith`, `endswith`, and `equals`, `/` or `\` separates alternatives, with any matching alternative sufficient. --- Source: https://www.advancedrenamer.com/technical/aren-format/tags-and-patterns.md # Advanced Renamer .aren tags, patterns, and method order This page accompanies the [JSON project reference](https://www.advancedrenamer.com/technical/aren-format/format-reference), based on Advanced Renamer 4.29. Tag expressions are strings inside JSON; they are not JSON variables or JavaScript template expressions. ## Method order and original filenames Methods run from the first element of `methods` to the last. Text-editing methods such as Replace normally operate on the current name produced by earlier methods. `` returns the **original** basename and `` returns the **original** extension without a dot. They do not automatically refer to an earlier method's output. With `applyto: "name"`, leave the extension out of the generated mask: `Photo_` preserves the current extension. With `applyto: "nameandextension"`, include the dot and extension explicitly: `Photo_.`. ## Useful tags for generated projects | Tag | Meaning / example | | --- | --- | | `` | Original basename, excluding the final extension. | | `` | Original extension without its leading dot. | | `` | Immediate containing folder; higher indices refer to ancestors. | | `` | Increasing counter starting at 1, with explicit padding to at least three digits. | | `` | Increasing counter starting at 10 and stepping by 2: `010`, `012`, `014`, … | | `` | Counter starting at 1 with one-digit minimum padding. | | `` | First word of the original basename using the effective word separators. | | `` | Last word of the original basename. | | `` | First word with an explicit hyphen word separator. | | `` | First three characters of the current basename. | | `--` | Current batch date, not a photo's capture date. | | `--` | Filesystem modification date. | | `--` | Filesystem creation date, where available. | | `--` | Image/media date resolved by the application's metadata settings. | | `` | Original date from image metadata, when present. | | ``, `<Author>` | Native metadata fields discovered when files are added; use the field name directly as a tag. | | `<Metadata:FIELD>` | Access a native metadata field whose name clashes with a built-in tag. | | `<ExifTool:FIELD>` | Access an ExifTool field only when native metadata support is lacking; requires the application's ExifTool integration. | This table is a practical subset. See the [user guide's Tags section](https://www.advancedrenamer.com/user_guide/tags) for the tag catalog, discovery, and parameter rules. Tag names are case-insensitive. Date/time formats use the application's date formatting conventions, for example `yyyy-mm-dd` and `hh-nn-ss` (`nn` is minutes). Do not substitute Python `%Y` syntax or JavaScript date formatting tokens. ## Native metadata tags and discovery Advanced Renamer has extensive native metadata support. When files are added, the program analyses them and makes the discovered metadata fields available on the fly as first-class tags, using each field's name: for example, `<Title>` or `<Author>`. The available fields depend on the file format and the metadata present; they are not limited to the tags listed above. `<Metadata:FIELD>` is only needed to disambiguate a metadata field name that clashes with a built-in tag: for example, `<Name>` means the original basename, while `<Metadata:Name>` accesses a metadata field named `Name` if one exists. Use `<ExifTool:FIELD>` only when the program lacks native support for the required metadata. It is not the normal way to access image, audio, video, or document metadata. Metadata-dependent masks need actual metadata in the input files. Missing metadata can produce blank components; use [tag fallback](#tag-fallback) when a value may be absent. ## Tag modifiers Modifiers transform a tag's value before it is inserted into the filename. Append them inside the angle brackets, after the tag's own parameters. Modifiers can have parameters and can be chained; they run from left to right. Once modifiers begin, later parameters belong to modifiers, not to the original tag. | Expression | Result | | --- | --- | | `<Title:lower>` | Lowercase title. | | `<Title:substr:1:10:upper>` | First ten characters of the title, then uppercase. | | `<Title:trim:replace: :_>` | Trim surrounding whitespace, then replace spaces with underscores. | | `<Title:append: - scan>` | Append ` - scan` only when the title has a value. | | `<Width:pad:4:0>` | Pad the width on the left with zeroes to at least four characters. | Most modifiers leave empty values empty, including `append` and `prepend`. The exceptions are `default:text`, which supplies literal text, and `alt:tagname`, which tries another tag. For example, `<Title:alt:Subject:default:Untitled:lower>` chooses a value and then lowercases it. See [Tag Modifiers in the user guide](https://www.advancedrenamer.com/user_guide/tag_modifiers) for the full list. A complete project with expected results is available in [Clean native metadata with tag modifiers](https://www.advancedrenamer.com/technical/aren-format/examples#32-clean-native-metadata-with-tag-modifiers). ## Tag fallback Fallback supplies a value when a tag is empty: - `<Title|Untitled>` uses the literal text `Untitled` if `Title` is empty. - `<Title||Subject>` tries the `Subject` tag if `Title` is empty. Do not put angle brackets around the alternative tag name. - `<Title||Subject|Untitled>` tries `Title`, then `Subject`, then the literal text `Untitled`, stopping at the first non-empty value. Place the fallback chain before tag parameters and modifiers. The selected value is then formatted and modified: `<Title||Subject|Untitled:lower>` lowercases whichever value was selected, including the literal default. Similarly, `<Img Month||Month Modified:Xxxx>` formats the available month as a month name. The `alt` and `default` modifiers offer control over when fallback happens within a modifier chain. For example, `<Title:lower:default:Untitled>` leaves the default as `Untitled`, while `<Title|Untitled:lower>` produces `untitled` when the title is empty. See [Tag Fallback in the user guide](https://www.advancedrenamer.com/user_guide/tag_fallback) and the complete [Fall back between metadata tags and literal text example](https://www.advancedrenamer.com/technical/aren-format/examples#33-fall-back-between-metadata-tags-and-literal-text). ## Regex syntax inside JSON Regex-enabled methods use the application's modified TRegExpr engine with Unicode matching. See the dedicated [regular expression reference](https://www.advancedrenamer.com/technical/aren-format/regex-reference) for JSON encoding and capture substitutions. Set `"regularexpressions": true` on a supporting method and double backslashes in JSON: pattern `\d+` becomes `"\\d+"`. Replace and List Replace accept `$1` or `\1` for group 1; JSON encodes these as `"$1"` or `"\\1"`. Lowercase a capture with `\L$1` or `\L\1`, and uppercase it with `\U$1` or `\U\1`. Bare `\L1` and `\U1` produce literal `1`, not captured text. See the [replacement and JSON escaping notes](https://www.advancedrenamer.com/technical/aren-format/regex-reference) for exact forms. ## Non-regex replacement is not always literal In the Replace method, with regular expressions disabled: - `/` and `\` separate multiple search patterns. - `*` can activate wildcard matching. - Matching is case-insensitive unless `casesensitive` is true. - `occurrence: 0` replaces all matches; positive values select an occurrence. ## Positions and characters For common positional edits, use one-based positions encoded as strings: `"position": "1"`, `"start": "1"`, `"count": "3"`. For Add, `"position": "0", "backwards": true` appends to the selected portion. More complex position/count fields can interpret patterns and tags according to the method's rules; do not assume they are arithmetic expressions. --- Source: https://www.advancedrenamer.com/technical/aren-format/regex-reference.md # Advanced Renamer regular expression reference This reference describes the modified regular expressions engine bundled with Advanced Renamer 4.29, including the application's replacement handling. It applies to regex-enabled renaming methods. The Script method uses JavaScript's own regular expression engine and replacement syntax. ## Enable regex and choose the input Set `"regularexpressions": true` on a method that supports it. See the [method reference](https://www.advancedrenamer.com/technical/aren-format/format-reference) for the applicable fields. Regex syntax has no effect in fields that do not support regular expressions. Replace searches the current name produced by preceding methods. `"applyto": "name"` searches the basename and preserves the extension; `"extension"` searches the extension alone, and `"nameandextension"` searches the complete filename. For example, `^report$` matches `report.txt` with `applyto: "name"`, but does not match the complete filename. An unanchored pattern searches within that input. Use `^` and `$` to require a whole-name match. Replace's `occurrence: 0` replaces every non-overlapping match; a positive integer replaces only that occurrence, counting from 1. If no match exists, the name is unchanged. List Replace replaces all matches for each row and applies its rows sequentially. ## Pattern syntax Some constructs supported by the engine are restricted in fields that also parse tags; see [Tags and regex](#tags-and-regex-in-the-same-method). The expressions in this table are the text entered into the application's pattern field, before JSON escaping. | Pattern | Meaning | | --- | --- | | `report` | Literal text, found anywhere unless anchored. | | `.` | One Unicode code point. | | `\.` | A literal dot. Escape regex punctuation when matching it literally. | | `[abc]`, `[a-z]`, `[^abc]` | One listed character, one character in a range, or one outside the class. | | `\d`, `\D` | An ASCII digit `0`–`9`, or a character outside that set. | | `\w`, `\W` | A Unicode letter, mark, number, or underscore; or a character outside that set. | | `\s`, `\S` | A whitespace character, or a non-whitespace character. | | `\b`, `\B` | A word boundary, or a position that is not a word boundary, using Unicode word characters. | | `^`, `$` | Start and end of the selected filename portion. | | `a*`, `a+`, `a?` | Zero or more, one or more, or zero or one occurrence of `a`. | | `a{3}`, `a{3,}`, `a{3,5}` | Exactly three, at least three, or three to five occurrences. | | `.*?`, `.+?`, `a{3,5}?` | Lazy repetition: try the shortest match first. Repetition is greedy by default. | | `a++`, `a*+`, `a{3,5}+` | Possessive repetition: do not give matched characters back during backtracking. | | `cat\|dog` | Alternation: either branch. Group alternatives when adding surrounding text. | | `(pattern)` | Capturing group, numbered by opening parenthesis from 1. | | `(?:pattern)` | Group without capturing or changing capture numbering. | | `(?<part>pattern)` | Named capturing group, usable as `${part}` in replacement text. | | `\1` | In a search pattern, match the same text captured by group 1. | | `(?=pattern)`, `(?!pattern)` | Positive or negative lookahead; test following text without consuming it. | | `(?<=pattern)`, `(?<!pattern)` | Engine-supported positive or negative lookbehind; rejected in Replace/List Replace by tag validation. | | `(?>pattern)` | Engine-supported atomic group; rejected in Replace/List Replace by tag validation. | Capture references in a pattern use `\1`; `$1` is replacement syntax. ## Case and inline modifiers Replace and List Replace use `casesensitive: false` for case-insensitive matching and `true` for case-sensitive matching. This affects matching, not the case of captured text returned by substitutions. | Inline modifier | Effect | | --- | --- | | `(?i)`, `(?-i)` | Enable or disable case-insensitive matching from this point. | | `(?x)`, `(?-x)` | Enable or disable extended syntax, which ignores pattern whitespace and permits `#` comments outside character classes. | | `(?i:pattern)` | Apply a modifier within this group only. | For example, `(?-i)^IMG_\d+$` requires uppercase `IMG_`, even when the method otherwise ignores case. Inline `(?i)` means ignore case; it is unrelated to the `\U` replacement case conversion described below. Regex patterns are plain expressions without JavaScript-style `/.../flags` delimiters. ## Unicode support and limits Patterns operate on Unicode code points, including accented letters and supplementary characters such as emoji. A combining accent counts as a separate code point; the engine does not automatically normalize composed and decomposed spellings. Use Unicode general categories for more precise matching: | Pattern | Meaning | | --- | --- | | `\p{L}`, `\pL` | Any Unicode letter. | | `\p{Lu}`, `\p{Ll}`, `\p{Lt}`, `\p{Lm}`, `\p{Lo}` | Uppercase, lowercase, titlecase, modifier, or other letter. | | `\p{M}` | Combining mark; subcategories are `Mn`, `Mc`, and `Me`. | | `\p{N}` | Number; subcategories are `Nd`, `Nl`, and `No`. | | `\p{Nd}` | Decimal digit, including non-ASCII digits. | | `\p{P}`, `\p{S}`, `\p{Z}`, `\p{C}` | Punctuation, symbol, separator, or other character. | | `\P{L}` | Any character outside the letter category. | | `[\p{L}\p{M}]` | A letter or combining mark. | For names containing combining accents, `\p{L}[\p{L}\p{M}]*` requires an initial letter and allows subsequent letters and marks. Add spaces, apostrophes, or hyphens explicitly if the naming rule allows them. `\w` also permits numbers and underscores. Only short general-category codes and their supported two-letter subcategories are accepted. Names such as `\p{Letter}` and script/block names such as `\p{Latin}` are not supported. `\x{...}` escapes are limited to U+FFFF; enter supplementary characters literally. Supplementary character ranges and supplementary case folding are not supported. Case conversion uses single-character mappings, so do not expect expansions such as `ß` to `SS`. ## Replacement text and captures Replace and List Replace support the following substitutions. These are replacement expressions, before JSON escaping; they do not describe search-pattern syntax. | Replacement | Result | | --- | --- | | `$1`, `\1` | Text captured by numbered group 1. The application converts `\1` to `$1` before substitution. | | `${1}` | Explicitly delimited group number. `${1}0` means group 1 followed by literal `0`; `$10` means group 10. | | `${part}` | Text captured by the named group `(?<part>...)`. | | `$0`, `$&` | The entire regex match. | | `\L$1`, `\L\1` | Lowercase the text captured by group 1. | | `\U$1`, `\U\1` | Uppercase the text captured by group 1. | | `\l$1`, `\u$1` | Lowercase or uppercase only the first character of group 1. | | `$` | A literal dollar sign. `$$` produces two dollar signs, not one. | **Bare `\L1` and `\U1` are not capture substitutions.** They produce the literal digit `1`. Include `$1` or `\1` after the case-conversion marker. Case conversion applies to the following capture and then resets. For example, `\U$1-$2` uppercases group 1 while preserving group 2's case. Repeat the marker to convert another capture: `\U$1-\U$2`. A literal character immediately after a marker consumes that conversion, so keep the marker adjacent to the capture. `\E` is not a supported end-of-conversion marker. Captured text retains its original case even when matching ignores case. An optional group that did not participate contributes an empty string. Text outside the matched region is retained. An empty replacement deletes the matched text. ## Tags and regex in the same method Replace and List Replace expand Advanced Renamer tags in search and replacement fields before regex processing. For example, `<Title>` is a metadata tag, while `$1` is a regex capture substitution. Tag expansion and regex escaping are separate steps: a metadata value inserted into a search pattern can itself contain regex punctuation. Prefer numbered backreferences such as `\1` inside search patterns; angle-bracket forms such as `\k<part>` can be interpreted as tags by the application's tag parser. To match literal angle brackets, use regex escapes `\x3C` and `\x3E` rather than tag-like text. ## JSON escaping Double every regex or replacement backslash when writing a JSON string. Dollar signs need no JSON escaping. The application's text fields use the expression in the middle column; `.aren` files use the JSON string in the right column. | Purpose | Expression | JSON string | | --- | --- | --- | | One or more ASCII digits | `\d+` | `"\\d+"` | | A literal dot | `\.` | `"\\."` | | Unicode letters | `\p{L}+` | `"\\p{L}+"` | | Repeated captured text in a pattern | `^(\w+)_\1$` | `"^(\\w+)_\\1$"` | | Group 1 in replacement | `$1` | `"$1"` | | Group 1, alternate replacement syntax | `\1` | `"\\1"` | | Lowercase group 1 | `\L$1` | `"\\L$1"` | | Lowercase group 1, alternate syntax | `\L\1` | `"\\L\\1"` | | Uppercase group 1 | `\U$1` | `"\\U$1"` | | Uppercase group 1, alternate syntax | `\U\1` | `"\\U\\1"` | | Named capture in replacement | `${part}` | `"${part}"` | | Match a literal backslash | `\\` | `"\\\\"` | | A literal double quote | `"` | `"\""` | A JSON string such as `"\1"` or `"\U1"` is invalid JSON. The same text inside a programming-language string may need another escaping layer; do not copy that extra layer into the `.aren` file. A Windows path such as `C:\Photos\Output` uses `"C:\\Photos\\Output"`. ## Worked examples For a date rearrangement, this method changes `2026-11-06_report.txt` to `06-11-2026_report.txt`: ```json { "methodname": "replace", "active": true, "applyto": "name", "replace": "^(\\d{4})-(\\d{2})-(\\d{2})_(.+)$", "replacewith": "$3-$2-$1_$4", "casesensitive": false, "regularexpressions": true, "occurrence": 0 } ``` This is a method object to put in `methods`, not a complete project. Complete projects with expected results are available for [backslash capture substitutions](https://www.advancedrenamer.com/technical/aren-format/examples#34-rearrange-captures-with-backslash-substitutions), [capture case conversion](https://www.advancedrenamer.com/technical/aren-format/examples#35-change-the-case-of-regex-captures), [named captures](https://www.advancedrenamer.com/technical/aren-format/examples#36-rearrange-named-regex-captures), and [lookahead](https://www.advancedrenamer.com/technical/aren-format/examples#37-replace-numbers-before-a-suffix-with-lookahead). --- Source: https://www.advancedrenamer.com/technical/aren-format/examples.md # Advanced Renamer .aren worked examples Each example pairs a request with a complete `.aren` project file and expected results. Every file uses `"type": "project"` and follows the [field reference](https://www.advancedrenamer.com/technical/aren-format/format-reference). Application usage is described in the [user guide](https://www.advancedrenamer.com/user_guide/gettingstarted). Format target: Advanced Renamer 4.29. Files are UTF-8. Inputs are files in the same folder, checked and arranged in the displayed order unless stated otherwise. Expected results assume increment-tag zero padding is enabled and automatic filename character cleanup is disabled. Timestamps use local wall-clock time. These files do not select or sort input items or set these application options. ## 1. Replace underscores with spaces Request: Replace underscores with spaces and keep extensions. File: [underscores-to-spaces.aren](https://www.advancedrenamer.com/technical/aren-format/examples/underscores-to-spaces.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "_", "replacewith": " ", "casesensitive": false, "regularexpressions": false, "occurrence": 0 } ] } ``` | Original filename | New filename | | --- | --- | | `summer_holiday.jpg` | `summer holiday.jpg` | | `annual_report.PDF` | `annual report.PDF` | ## 2. Add a prefix Request: Prefix every basename with Archive_. File: [add-prefix.aren](https://www.advancedrenamer.com/technical/aren-format/examples/add-prefix.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "add", "active": true, "applyto": "name", "add": "Archive_", "position": "1", "backwards": false, "regularexpressions": false } ] } ``` | Original filename | New filename | | --- | --- | | `report.pdf` | `Archive_report.pdf` | | `image.JPG` | `Archive_image.JPG` | ## 3. Add a suffix before the extension Request: Append _approved to each basename, keeping the extension. File: [add-suffix.aren](https://www.advancedrenamer.com/technical/aren-format/examples/add-suffix.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "add", "active": true, "applyto": "name", "add": "_approved", "position": "0", "backwards": true, "regularexpressions": false } ] } ``` | Original filename | New filename | | --- | --- | | `report.pdf` | `report_approved.pdf` | | `image.JPG` | `image_approved.JPG` | ## 4. Create padded sequential names Request: Name these files Photo_001, Photo_002, and so on, preserving extensions. Arrange the files in the required order. Increment-tag zero padding must be enabled; this project file does not set that option. File: [numbered-photos.aren](https://www.advancedrenamer.com/technical/aren-format/examples/numbered-photos.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "newname", "active": true, "applyto": "name", "mask": "Photo_<Inc Nr:001>" } ] } ``` | Original filename | New filename | | --- | --- | | `DSC100.jpg` | `Photo_001.jpg` | | `DSC200.PNG` | `Photo_002.PNG` | ## 5. Set a counter start and step Request: Use scan_010, scan_012, scan_014 in the displayed order. The second counter parameter is the step, not a padding width. Increment-tag zero padding must be enabled. File: [counter-step.aren](https://www.advancedrenamer.com/technical/aren-format/examples/counter-step.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "newname", "active": true, "applyto": "name", "mask": "scan_<Inc Nr:010:2>" } ] } ``` | Original filename | New filename | | --- | --- | | `a.tif` | `scan_010.tif` | | `b.tif` | `scan_012.tif` | | `c.tif` | `scan_014.tif` | ## 6. Lowercase basenames only Request: Lowercase the basename, leaving the extension exactly as it is. File: [lowercase-basename.aren](https://www.advancedrenamer.com/technical/aren-format/examples/lowercase-basename.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "newcase", "active": true, "applyto": "name", "newcasetype": "lower", "newcaselocation": "all", "applylowercasefirst": false, "ignorewordsallcaps": false } ] } ``` | Original filename | New filename | | --- | --- | | `Annual_REPORT.PDF` | `annual_report.PDF` | ## 7. Lowercase the whole filename Request: Lowercase filenames including their extensions. File: [lowercase-whole-filename.aren](https://www.advancedrenamer.com/technical/aren-format/examples/lowercase-whole-filename.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "newcase", "active": true, "applyto": "nameandextension", "newcasetype": "lower", "newcaselocation": "all", "applylowercasefirst": false, "ignorewordsallcaps": false } ] } ``` | Original filename | New filename | | --- | --- | | `Annual_REPORT.PDF` | `annual_report.pdf` | ## 8. Uppercase extensions only Request: Uppercase only the extensions. File: [uppercase-extension.aren](https://www.advancedrenamer.com/technical/aren-format/examples/uppercase-extension.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "newcase", "active": true, "applyto": "extension", "newcasetype": "upper", "newcaselocation": "all", "applylowercasefirst": false, "ignorewordsallcaps": false } ] } ``` | Original filename | New filename | | --- | --- | | `annual_report.pdf` | `annual_report.PDF` | | `photo.jpg` | `photo.JPG` | ## 9. Normalize JPEG extensions Request: Change jpg and jpeg extensions to jpg, preserving basename case and leaving other extensions alone. File: [normalize-jpeg-extension.aren](https://www.advancedrenamer.com/technical/aren-format/examples/normalize-jpeg-extension.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "newname", "active": true, "applyto": "extension", "mask": "jpg", "condition": { "active": true, "field": "ext", "match": "equals", "pattern": "jpg/jpeg", "notmatching": false } } ] } ``` | Original filename | New filename | | --- | --- | | `Portrait.JPEG` | `Portrait.jpg` | | `Snapshot.JPG` | `Snapshot.jpg` | | `Diagram.PNG` | `Diagram.PNG` | ## 10. Rearrange a date using regex captures Request: Convert YYYY-MM-DD_report to DD-MM-YYYY_report, preserving extensions. File: [reorder-date.aren](https://www.advancedrenamer.com/technical/aren-format/examples/reorder-date.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "^(\\d{4})-(\\d{2})-(\\d{2})_(.+)$", "replacewith": "$3-$2-$1_$4", "casesensitive": false, "regularexpressions": true, "occurrence": 0 } ] } ``` | Original filename | New filename | | --- | --- | | `2026-11-06_report.txt` | `06-11-2026_report.txt` | | `notes.txt` | `notes.txt` | ## 11. Collapse whitespace to a hyphen Request: Replace each run of whitespace in basenames with one hyphen. File: [collapse-whitespace.aren](https://www.advancedrenamer.com/technical/aren-format/examples/collapse-whitespace.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "\\s+", "replacewith": "-", "casesensitive": false, "regularexpressions": true, "occurrence": 0 } ] } ``` | Original filename | New filename | | --- | --- | | `annual report.txt` | `annual-report.txt` | | `one three.jpg` | `one-three.jpg` | ## 12. Replace only the second occurrence Request: Change only the second underscore in each basename to a hyphen. File: [replace-second-occurrence.aren](https://www.advancedrenamer.com/technical/aren-format/examples/replace-second-occurrence.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "_", "replacewith": "-", "casesensitive": false, "regularexpressions": false, "occurrence": 2 } ] } ``` | Original filename | New filename | | --- | --- | | `one_two_three_four.txt` | `one_two-three_four.txt` | ## 13. Remove a fixed number of leading characters Request: Remove the first four characters of each basename. File: [remove-prefix-characters.aren](https://www.advancedrenamer.com/technical/aren-format/examples/remove-prefix-characters.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "remove", "active": true, "applyto": "name", "removetype": "position", "start": "1", "count": "4", "backwards": false, "regularexpressions": false } ] } ``` | Original filename | New filename | | --- | --- | | `old_report.pdf` | `report.pdf` | | `old_photo.jpg` | `photo.jpg` | ## 14. Remove characters from the end Request: Remove the last four characters of each basename. File: [remove-suffix-characters.aren](https://www.advancedrenamer.com/technical/aren-format/examples/remove-suffix-characters.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "remove", "active": true, "applyto": "name", "removetype": "position", "start": "1", "count": "4", "backwards": true, "regularexpressions": false } ] } ``` | Original filename | New filename | | --- | --- | | `report_old.pdf` | `report.pdf` | | `photo_old.jpg` | `photo.jpg` | ## 15. Remove bracketed text Request: Remove a space followed by a bracketed suffix from the basename. File: [remove-bracketed-text.aren](https://www.advancedrenamer.com/technical/aren-format/examples/remove-bracketed-text.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "remove", "active": true, "applyto": "name", "removetype": "pattern", "pattern": " \\[[^\\]]*\\]$", "regularexpressions": true, "casesensitive": false, "location": "anywhere" } ] } ``` | Original filename | New filename | | --- | --- | | `report [draft].pdf` | `report.pdf` | | `photo [copy].jpg` | `photo.jpg` | ## 16. Use the separate Remove Pattern method Request: Using the separate Remove Pattern method, remove a leading TEMP_ prefix. This example uses `removepattern`. For new pattern-removal tasks, prefer `remove` with `removetype: "pattern"`. File: [legacy-remove-pattern.aren](https://www.advancedrenamer.com/technical/aren-format/examples/legacy-remove-pattern.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "removepattern", "active": true, "applyto": "name", "pattern": "^TEMP_", "regularexpressions": true, "casesensitive": false } ] } ``` | Original filename | New filename | | --- | --- | | `TEMP_report.txt` | `report.txt` | | `keep.txt` | `keep.txt` | ## 17. Trim edge punctuation Request: Trim spaces, underscores and hyphens from both ends of the basename. File: [trim-edges.aren](https://www.advancedrenamer.com/technical/aren-format/examples/trim-edges.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "trim", "active": true, "applyto": "name", "characters": " _-", "location": "start_and_end", "casesensitive": false, "inversematch": false } ] } ``` | Original filename | New filename | | --- | --- | | `__report--.pdf` | `report.pdf` | | `-photo_.jpg` | `photo.jpg` | ## 18. Move a segment within the basename Request: Move the first two characters of each basename to its end. The destination is beyond these basenames, so the moved segment is appended. This moves characters, not files. File: [move-characters.aren](https://www.advancedrenamer.com/technical/aren-format/examples/move-characters.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "move", "active": true, "applyto": "name", "movefrom": "1", "movecount": "2", "moveto": "999", "relative": false, "backwards": false, "regularexpressions": false } ] } ``` | Original filename | New filename | | --- | --- | | `ABreport.txt` | `reportAB.txt` | | `XYphoto.jpg` | `photoXY.jpg` | ## 19. Swap artist and title Request: Swap the parts around the first space-hyphen-space separator. File: [swap-parts.aren](https://www.advancedrenamer.com/technical/aren-format/examples/swap-parts.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "swap", "active": true, "applyto": "name", "separator": " - ", "occurrence": 1 } ] } ``` | Original filename | New filename | | --- | --- | | `Artist - Title.mp3` | `Title - Artist.mp3` | | `Band - Song.flac` | `Song - Band.flac` | ## 20. Increase an existing number Request: Add 10 to the first existing number, keeping three-digit padding. File: [increase-existing-number.aren](https://www.advancedrenamer.com/technical/aren-format/examples/increase-existing-number.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "renumber", "active": true, "applyto": "name", "numberposition": 1, "change": "relative", "newnumber": 1, "numberdifference": 10, "skip": 1, "zeropad": "manual", "numberlength": 3, "negativenumbers": false } ] } ``` | Original filename | New filename | | --- | --- | | `image_001.jpg` | `image_011.jpg` | | `image_020.jpg` | `image_030.jpg` | | `cover.jpg` | `cover.jpg` | ## 21. Replace an existing number with a new sequence Request: Renumber the first existing number as 100, 105, 110 in the displayed order. File: [renumber-existing-sequence.aren](https://www.advancedrenamer.com/technical/aren-format/examples/renumber-existing-sequence.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "renumber", "active": true, "applyto": "name", "numberposition": 1, "change": "absolute", "newnumber": 100, "numberdifference": 1, "skip": 5, "zeropad": "manual", "numberlength": 3, "negativenumbers": false } ] } ``` | Original filename | New filename | | --- | --- | | `item_7.txt` | `item_100.txt` | | `item_8.txt` | `item_105.txt` | | `item_9.txt` | `item_110.txt` | ## 22. Assign an explicit list of names Request: Name the first three files Introduction, Methods, Results, preserving extensions. The input order must match the displayed list. `newnames` is a single JSON string containing escaped newlines. File: [explicit-list.aren](https://www.advancedrenamer.com/technical/aren-format/examples/explicit-list.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "list", "active": true, "applyto": "name", "newnames": "Introduction\nMethods\nResults" } ] } ``` | Original filename | New filename | | --- | --- | | `a.txt` | `Introduction.txt` | | `b.txt` | `Methods.txt` | | `c.txt` | `Results.txt` | ## 23. Apply multiple replacement rows Request: Change underscores to spaces, then change draft to final. File: [ordered-replacements.aren](https://www.advancedrenamer.com/technical/aren-format/examples/ordered-replacements.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "listreplace", "active": true, "applyto": "name", "replace": [ "_", "draft" ], "replacewith": [ " ", "final" ], "casesensitive": false, "regularexpressions": false } ] } ``` | Original filename | New filename | | --- | --- | | `draft_report.txt` | `final report.txt` | | `draft_photo.jpg` | `final photo.jpg` | ## 24. Apply a method only to PDFs Request: Prefix only PDF basenames with Doc_. File: [conditional-prefix.aren](https://www.advancedrenamer.com/technical/aren-format/examples/conditional-prefix.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "add", "active": true, "applyto": "name", "add": "Doc_", "position": "1", "backwards": false, "regularexpressions": false, "condition": { "active": true, "field": "ext", "match": "equals", "pattern": "pdf", "notmatching": false } } ] } ``` | Original filename | New filename | | --- | --- | | `report.PDF` | `Doc_report.PDF` | | `photo.jpg` | `photo.jpg` | ## 25. Compose methods in order Request: Replace underscores with spaces, then prefix the resulting basename with Copy_. Add operates on the current name, so it preserves the earlier replacement. File: [ordered-cleanup.aren](https://www.advancedrenamer.com/technical/aren-format/examples/ordered-cleanup.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "_", "replacewith": " ", "casesensitive": false, "regularexpressions": false, "occurrence": 0 }, { "methodname": "add", "active": true, "applyto": "name", "add": "Copy_", "position": "1", "backwards": false, "regularexpressions": false } ] } ``` | Original filename | New filename | | --- | --- | | `red_car.JPG` | `Copy_red car.JPG` | ## 26. Distinguish original names from current names Request: Replace underscores with spaces, then rebuild the name as copy_ plus the ORIGINAL basename. The underscore returns because `<Name>` reads the original basename. Use Add instead when the intention is to prefix the already-edited name. File: [original-name-tag.aren](https://www.advancedrenamer.com/technical/aren-format/examples/original-name-tag.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "_", "replacewith": " ", "casesensitive": false, "regularexpressions": false, "occurrence": 0 }, { "methodname": "newname", "active": true, "applyto": "name", "mask": "copy_<Name>" } ] } ``` | Original filename | New filename | | --- | --- | | `red_car.JPG` | `copy_red_car.JPG` | ## 27. Preserve Unicode text Request: Replace underscores with spaces and prefix the Unicode basename with Arkiv_. File: [unicode-text.aren](https://www.advancedrenamer.com/technical/aren-format/examples/unicode-text.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "_", "replacewith": " ", "casesensitive": false, "regularexpressions": false, "occurrence": 0 }, { "methodname": "add", "active": true, "applyto": "name", "add": "Arkiv_", "position": "1", "backwards": false, "regularexpressions": false } ] } ``` | Original filename | New filename | | --- | --- | | `Müller_Øresund.txt` | `Arkiv_Müller Øresund.txt` | | `東京_写真.jpg` | `Arkiv_東京 写真.jpg` | ## 28. Store a simple JavaScript method Request: Use a Script method to append _done to the current basename. The script is an Advanced Renamer method body inside a JSON string. No external JavaScript module is imported. File: [script-suffix.aren](https://www.advancedrenamer.com/technical/aren-format/examples/script-suffix.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "script", "active": true, "applyto": "name", "script": "return item.newBasename + \"_done\";", "prescript": "" } ] } ``` | Original filename | New filename | | --- | --- | | `report.pdf` | `report_done.pdf` | ## 29. Set the modification timestamp Request: Set the file modification timestamp to 6 November 2026 at 12:30:00 without renaming the file. Timestamp applyto is modified, not name. This changes filesystem metadata when the batch runs. The expected timestamp is local wall-clock time, subject to filesystem support. File: [set-modified-timestamp.aren](https://www.advancedrenamer.com/technical/aren-format/examples/set-modified-timestamp.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "timestamp", "active": true, "applyto": "modified", "change": "absolute", "year": 2026, "month": 11, "day": 6, "hour": 12, "minute": 30, "second": 0 } ] } ``` | Original filename | New filename | | --- | --- | | `report.txt` | `report.txt` | | Filename | Modified timestamp before | Modified timestamp after | | --- | --- | --- | | `report.txt` | `2025-01-02T03:04:05` | `2026-11-06T12:30:00` | ## 30. Move files without renaming Request: Move these files into an Output subfolder of their source folder, preserving the filenames. The empty `methods` array preserves filenames. `batchmode` selects the move operation; `outputfolder` is relative to each source folder. File: [move-without-renaming.aren](https://www.advancedrenamer.com/technical/aren-format/examples/move-without-renaming.aren) ```json { "type": "project", "batchmode": "move", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "outputfolder": "Output", "methods": [] } ``` | Original filename | New filename | | --- | --- | | `report.pdf` | `report.pdf` | | `photo.jpg` | `photo.jpg` | ## 31. Copy files without renaming Request: Copy these files into an Output subfolder of their source folder, preserving the filenames. The empty `methods` array preserves filenames. `batchmode` selects the copy operation; `outputfolder` is relative to each source folder. File: [copy-without-renaming.aren](https://www.advancedrenamer.com/technical/aren-format/examples/copy-without-renaming.aren) ```json { "type": "project", "batchmode": "copy", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "outputfolder": "Output", "methods": [] } ``` | Original filename | New filename | | --- | --- | | `report.pdf` | `report.pdf` | | `photo.jpg` | `photo.jpg` | ## 32. Clean native metadata with tag modifiers Request: Use each SVG file's native Title metadata as its basename, trimming whitespace, lowercasing, and replacing spaces with underscores. `scan_1.svg` has Title ` Coastal Sunset `; `scan_2.svg` has Title `Forest Path`. These are native metadata values, not the original basenames. The modifiers run left to right and the SVG extension is preserved. See [Tag modifiers](https://www.advancedrenamer.com/technical/aren-format/tags-and-patterns). File: [metadata-tag-modifiers.aren](https://www.advancedrenamer.com/technical/aren-format/examples/metadata-tag-modifiers.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "newname", "active": true, "applyto": "name", "mask": "<Title:trim:lower:replace: :_>" } ] } ``` | Original filename | New filename | | --- | --- | | `scan_1.svg` | `coastal_sunset.svg` | | `scan_2.svg` | `forest_path.svg` | ## 33. Fall back between metadata tags and literal text Request: Name SVG files from Title, otherwise Desc, otherwise the literal Untitled; lowercase the selected value and replace spaces with underscores. `scan_1.svg` has Title `Coastal Sunset` and Desc `Evening View`; `scan_2.svg` has only Desc `Forest Path`; `scan_3.svg` has neither field. Desc is the native SVG description field. `||Desc` tries another tag, while `|Untitled` supplies literal text. Both fallbacks precede the modifiers, which apply to the selected value. See [Tag fallback](https://www.advancedrenamer.com/technical/aren-format/tags-and-patterns). File: [metadata-tag-fallback.aren](https://www.advancedrenamer.com/technical/aren-format/examples/metadata-tag-fallback.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "newname", "active": true, "applyto": "name", "mask": "<Title||Desc|Untitled:lower:replace: :_>" } ] } ``` | Original filename | New filename | | --- | --- | | `scan_1.svg` | `coastal_sunset.svg` | | `scan_2.svg` | `forest_path.svg` | | `scan_3.svg` | `untitled.svg` | ## 34. Rearrange captures with backslash substitutions Request: Move a leading YYYY-MM-DD date after the title using backslash capture substitutions, preserving the extension. The replacement uses `\4`, `\3`, `\2`, and `\1`, equivalent to `$4`, `$3`, `$2`, and `$1`. Every backslash is doubled in JSON. Files without the full pattern remain unchanged. See [Regex replacement text](https://www.advancedrenamer.com/technical/aren-format/regex-reference). File: [regex-backslash-captures.aren](https://www.advancedrenamer.com/technical/aren-format/examples/regex-backslash-captures.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "^(\\d{4})-(\\d{2})-(\\d{2})_(.+)$", "replacewith": "\\4_\\3-\\2-\\1", "casesensitive": false, "regularexpressions": true, "occurrence": 0 } ] } ``` | Original filename | New filename | | --- | --- | | `2026-11-06_report.txt` | `report_06-11-2026.txt` | | `2025-03-09_photo.jpg` | `photo_09-03-2025.jpg` | | `notes.txt` | `notes.txt` | ## 35. Change the case of regex captures Request: Uppercase the first word and lowercase the second word in two-part names, replacing the underscore with a hyphen. `\U\1` uppercases group 1 and `\L$2` lowercases group 2. The dollar and backslash capture forms can be mixed. Bare `\U1` or `\L2` would insert literal digits. Unicode letter matching includes accented letters. See [Capture substitutions](https://www.advancedrenamer.com/technical/aren-format/regex-reference). File: [regex-capture-case.aren](https://www.advancedrenamer.com/technical/aren-format/examples/regex-capture-case.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "^(\\p{L}+)_(\\p{L}+)$", "replacewith": "\\U\\1-\\L$2", "casesensitive": false, "regularexpressions": true, "occurrence": 0 } ] } ``` | Original filename | New filename | | --- | --- | | `Müller_REPORT.txt` | `MÜLLER-report.txt` | | `François_PHOTO.jpg` | `FRANÇOIS-photo.jpg` | ## 36. Rearrange named regex captures Request: Move the number in a name to the front, using named regex captures. Named captures use `(?<part>...)` in the pattern and `${part}` in the replacement. These are regex captures, distinct from Advanced Renamer metadata tags. See [Regex patterns](https://www.advancedrenamer.com/technical/aren-format/regex-reference). File: [regex-named-captures.aren](https://www.advancedrenamer.com/technical/aren-format/examples/regex-named-captures.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "^(?<title>\\p{L}+)_(?<number>\\d+)$", "replacewith": "${number}_${title}", "casesensitive": false, "regularexpressions": true, "occurrence": 0 } ] } ``` | Original filename | New filename | | --- | --- | | `report_123.txt` | `123_report.txt` | | `photo_007.jpg` | `007_photo.jpg` | ## 37. Replace numbers before a suffix with lookahead Request: Replace digit sequences immediately before _take with PHOTO, leaving the suffix and other numbers intact. The lookahead `(?=_take)` tests the suffix without including it in the match. `\d+` matches the digits to replace. See [Regex strings and escaping](https://www.advancedrenamer.com/technical/aren-format/regex-reference). File: [regex-lookahead.aren](https://www.advancedrenamer.com/technical/aren-format/examples/regex-lookahead.aren) ```json { "type": "project", "batchmode": "rename", "pairrename": false, "foldermode": false, "namecollision.rule": "fail", "methods": [ { "methodname": "replace", "active": true, "applyto": "name", "replace": "\\d+(?=_take)", "replacewith": "PHOTO", "casesensitive": false, "regularexpressions": true, "occurrence": 0 } ] } ``` | Original filename | New filename | | --- | --- | | `IMG_123_take_2.jpg` | `IMG_PHOTO_take_2.jpg` | | `scan_123.jpg` | `scan_123.jpg` | --- Source: https://www.advancedrenamer.com/technical/aren-format/aren-project.schema.json # JSON Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Advanced Renamer .aren project authoring profile (4.29)", "description": "JSON authoring profile for Advanced Renamer 4.29 .aren projects.", "type": "object", "additionalProperties": false, "required": [ "type", "batchmode", "pairrename", "foldermode", "namecollision.rule", "methods" ], "properties": { "type": { "const": "project", "description": "Required. Always use \"project\"." }, "batchmode": { "type": "string", "enum": [ "rename", "move", "copy" ], "description": "Required. \"rename\", \"move\", or \"copy\". Specify explicitly." }, "pairrename": { "type": "boolean", "description": "Pair renaming. Prefer false enable only when the user intends paired-file behavior." }, "foldermode": { "type": "boolean", "description": "Required. false processes files; true processes folders. Copying folders is unsupported." }, "outputfolder": { "type": "string", "description": "Destination folder mask for move/copy mode. Use a real destination appropriate to the user's OS; supports tags. Omit when batchmode is \"rename\"." }, "namecollision.rule": { "type": "string", "enum": [ "fail", "ignore", "append_number", "append_character", "append_imgsubsec", "append_pattern", "newname" ], "description": "Collision rule identifier; use \"fail\" for a routine project. Property names containing dots are literal keys, not nested objects." }, "namecollision.separator": { "type": "string", "description": "Separator for collision rules that append text; defaults to \"_\".", "default": "_" }, "namecollision.pattern": { "type": "string", "description": "Pattern for append_pattern or newname collision rules; defaults to \"\".", "default": "" }, "namecollision.startvalue": { "type": "string", "description": "Start value for collision rule append_number or append_character; defaults to \"\". Use an explicit suitable value when choosing those rules.", "default": "" }, "methods": { "type": "array", "items": { "oneOf": [ { "$ref": "#/$defs/newname" }, { "$ref": "#/$defs/replace" }, { "$ref": "#/$defs/add" }, { "$ref": "#/$defs/newcase" }, { "$ref": "#/$defs/remove" }, { "$ref": "#/$defs/removepattern" }, { "$ref": "#/$defs/trim" }, { "$ref": "#/$defs/move" }, { "$ref": "#/$defs/swap" }, { "$ref": "#/$defs/renumber" }, { "$ref": "#/$defs/list" }, { "$ref": "#/$defs/listreplace" }, { "$ref": "#/$defs/script" }, { "$ref": "#/$defs/timestamp" } ] }, "description": "Methods to execute in order. For rename, include at least one active method. For move/copy without renaming, use []. The array order is the execution order." } }, "allOf": [ { "if": { "properties": { "batchmode": { "const": "rename" } } }, "then": { "properties": { "methods": { "minItems": 1, "contains": { "type": "object", "properties": { "active": { "const": true } }, "required": [ "active" ] } } }, "not": { "required": [ "outputfolder" ] } } }, { "if": { "properties": { "batchmode": { "enum": [ "move", "copy" ] } } }, "then": { "required": [ "outputfolder" ], "properties": { "outputfolder": { "type": "string", "minLength": 1 } } } }, { "if": { "properties": { "namecollision.rule": { "enum": [ "append_number", "append_character" ] } } }, "then": { "required": [ "namecollision.startvalue" ], "properties": { "namecollision.startvalue": { "type": "string", "minLength": 1 } } } }, { "if": { "properties": { "namecollision.rule": { "enum": [ "append_pattern", "newname" ] } } }, "then": { "required": [ "namecollision.pattern" ], "properties": { "namecollision.pattern": { "type": "string", "minLength": 1 } } } }, { "if": { "properties": { "batchmode": { "const": "copy" }, "foldermode": { "const": true } }, "required": [ "foldermode" ] }, "then": { "properties": { "foldermode": { "const": false } } } } ], "$defs": { "condition": { "type": "object", "additionalProperties": false, "required": [ "active", "field", "match", "pattern", "notmatching" ], "properties": { "active": { "type": "boolean", "description": "Must be true to enable the condition. This default differs from method active.", "default": false }, "field": { "type": "string", "enum": [ "name", "newname", "ext", "newext", "path", "pathandname", "newpathandname", "metadata" ], "description": "name, newname, ext, newext, path, pathandname, newpathandname, metadata.", "default": "name" }, "match": { "type": "string", "enum": [ "contains", "startswith", "endswith", "equals", "regex", "lengthshorter", "lengthlonger" ], "description": "contains, startswith, endswith, equals, regex, lengthshorter, lengthlonger.", "default": "contains" }, "pattern": { "type": "string", "description": "Search expression, alternatives, regex, or decimal length threshold. Empty pattern does not filter items.", "default": "" }, "notmatching": { "type": "boolean", "description": "Invert a nonempty active condition.", "default": false }, "metadatafield": { "type": "string", "description": "Required for field metadata.", "default": "" } }, "allOf": [ { "if": { "properties": { "field": { "const": "metadata" } } }, "then": { "required": [ "metadatafield" ], "properties": { "metadatafield": { "type": "string", "minLength": 1 } } } } ], "description": "Optional per-item condition for supported text methods; unavailable for List, Script, and Timestamp. Matching is case-insensitive. For contains, startswith, endswith, and equals, forward slashes or backslashes separate alternatives; any matching alternative is sufficient." }, "newname": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "mask" ], "properties": { "methodname": { "const": "newname", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "condition": { "$ref": "#/$defs/condition", "description": "Optional per-item condition." }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "mask": { "type": "string", "description": "New-name mask, e.g. \"Photo_<Inc Nr:001>\". Empty mask leaves the name unchanged. With applyto name, omit .<Ext> to avoid duplicating the extension.", "default": "" } }, "description": "Replaces the whole name with a mask containing text and tags." }, "replace": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "replace", "replacewith" ], "properties": { "methodname": { "const": "replace", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "condition": { "$ref": "#/$defs/condition", "description": "Optional per-item condition." }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "replace": { "type": "string", "description": "Search text, wildcard/pattern list, or regular expression.", "default": "" }, "replacewith": { "type": "string", "description": "Replacement text; supports tags and, in regex mode, capture references such as $1.", "default": "" }, "casesensitive": { "type": "boolean", "description": "Case-sensitive matching.", "default": false }, "regularexpressions": { "type": "boolean", "description": "Interpret the search as a regular expression.", "default": false }, "occurrence": { "type": "integer", "minimum": 0, "description": "0 replaces all matches; a positive value chooses an occurrence.", "default": 0 } }, "description": "Replaces matches in the selected portion of the current name." }, "add": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "add", "position" ], "properties": { "methodname": { "const": "add", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "condition": { "$ref": "#/$defs/condition", "description": "Optional per-item condition." }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "add": { "type": "string", "description": "Text or tag mask to insert.", "default": "" }, "position": { "type": "string", "description": "Insertion position.", "default": "1" }, "backwards": { "type": "boolean", "description": "Resolve positions from the end.", "default": false }, "regularexpressions": { "type": "boolean", "description": "Use regular expressions when resolving a position pattern.", "default": false } }, "description": "Inserts text in the selected portion of the current name." }, "newcase": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "newcasetype", "newcaselocation" ], "properties": { "methodname": { "const": "newcase", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "condition": { "$ref": "#/$defs/condition", "description": "Optional per-item condition." }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "newcasetype": { "type": "string", "enum": [ "lower", "upper", "inverse", "title" ], "description": "Required. lower, upper, inverse, title.", "default": "lower" }, "newcaselocation": { "type": "string", "enum": [ "all", "firstletter", "firstletter_word", "pattern", "position" ], "description": "Required. all, firstletter, firstletter_word, pattern, position.", "default": "all" }, "pattern": { "type": "string", "description": "Match pattern when location is pattern.", "default": "" }, "regularexpressions": { "type": "boolean", "description": "Regex matching for location pattern.", "default": false }, "posstart": { "type": "string", "description": "Start position when location is position; Use number in string for numeric value, \"1\".", "default": "" }, "poscount": { "type": "string", "description": "Character count when location is position; Use number in string for numeric value, \"10\".", "default": "" }, "applylowercasefirst": { "type": "boolean", "description": "Lowercase the selected name portion before applying the case change. Available only for upper or title, subject to the location rules below. Lowercases the whole portion selected by applyto before the location-specific change; when ignorewordsallcaps is also enabled, all-capital words are preserved during this step.", "default": false }, "ignorewordsallcaps": { "type": "boolean", "description": "Preserve words already entirely in capitals. Available for firstletter_word with any case type, or all with title.", "default": false } }, "allOf": [ { "if": { "properties": { "newcaselocation": { "const": "pattern" } } }, "then": { "required": [ "pattern" ] } }, { "if": { "properties": { "newcaselocation": { "const": "position" } } }, "then": { "required": [ "posstart", "poscount" ] } }, { "if": { "properties": { "applylowercasefirst": { "const": true } }, "required": [ "applylowercasefirst" ] }, "then": { "oneOf": [ { "properties": { "newcasetype": { "const": "title" }, "newcaselocation": { "const": "all" } } }, { "properties": { "newcasetype": { "enum": [ "upper", "title" ] }, "newcaselocation": { "enum": [ "firstletter", "firstletter_word", "pattern", "position" ] } } } ] } }, { "if": { "properties": { "ignorewordsallcaps": { "const": true } }, "required": [ "ignorewordsallcaps" ] }, "then": { "oneOf": [ { "properties": { "newcasetype": { "const": "title" }, "newcaselocation": { "const": "all" } } }, { "properties": { "newcaselocation": { "const": "firstletter_word" } } } ] } } ], "description": "Changes capitalization of the selected portion of the current name." }, "remove": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "removetype" ], "properties": { "methodname": { "const": "remove", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "condition": { "$ref": "#/$defs/condition", "description": "Optional per-item condition." }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "removetype": { "type": "string", "enum": [ "position", "pattern", "diacritics", "wordchars", "nonwordchars", "uppercase", "lowercase", "charlist", "numbers", "notnumbers" ], "description": "position, pattern, diacritics, wordchars, nonwordchars, uppercase, lowercase, charlist, numbers, notnumbers.", "default": "position" }, "start": { "type": "string", "description": "Start position for positional removal.", "default": "1" }, "count": { "type": "string", "description": "Count for positional removal.", "default": "1" }, "pattern": { "type": "string", "description": "Pattern when removetype is pattern.", "default": "" }, "backwards": { "type": "boolean", "description": "Resolve positional removal from the end.", "default": false }, "regularexpressions": { "type": "boolean", "description": "Regex matching when using a pattern.", "default": false }, "casesensitive": { "type": "boolean", "description": "Case-sensitive matching where applicable.", "default": false }, "charlist": { "type": "string", "description": "Characters for charlist removal.", "default": "" }, "charexceptions": { "type": "string", "description": "Character exceptions for supported category-removal modes.", "default": "" }, "location": { "type": "string", "enum": [ "anywhere", "start", "end" ], "description": "anywhere, start, end. Applies only to pattern, wordchars, nonwordchars, numbers, and notnumbers; ignored for all other removal types.", "default": "anywhere" } }, "allOf": [ { "if": { "properties": { "removetype": { "const": "position" } } }, "then": { "required": [ "start", "count" ] } }, { "if": { "properties": { "removetype": { "const": "pattern" } } }, "then": { "required": [ "pattern" ] } }, { "if": { "properties": { "removetype": { "const": "charlist" } } }, "then": { "required": [ "charlist" ] } } ], "description": "Removes characters by position, pattern, or character category." }, "removepattern": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "pattern" ], "properties": { "methodname": { "const": "removepattern", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "condition": { "$ref": "#/$defs/condition", "description": "Optional per-item condition." }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "pattern": { "type": "string", "description": "Pattern to remove.", "default": "" }, "casesensitive": { "type": "boolean", "description": "Case-sensitive matching.", "default": false }, "regularexpressions": { "type": "boolean", "description": "Regex matching.", "default": false } }, "description": "*Deprecated*. The older separate pattern-removal method remains loadable. Use remove method type with removetype: \"pattern\" instead.", "deprecated": true }, "trim": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "characters", "location" ], "properties": { "methodname": { "const": "trim", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "condition": { "$ref": "#/$defs/condition", "description": "Optional per-item condition." }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "characters": { "type": "string", "description": "A set of characters, not a regex.", "default": " .,_-" }, "location": { "type": "string", "enum": [ "start_and_end", "start", "end", "all" ], "description": "start_and_end, start, end, all.", "default": "start_and_end" }, "casesensitive": { "type": "boolean", "description": "Case-sensitive character comparison.", "default": false }, "inversematch": { "type": "boolean", "description": "Invert the character selection.", "default": false } }, "description": "Removes selected characters from edges, or throughout the selected name portion." }, "move": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "movefrom", "movecount", "moveto" ], "properties": { "methodname": { "const": "move", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "condition": { "$ref": "#/$defs/condition", "description": "Optional per-item condition." }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "movefrom": { "type": "string", "description": "Source position or position pattern.", "default": "1" }, "movecount": { "type": "string", "description": "Segment length or count pattern.", "default": "1" }, "moveto": { "type": "string", "description": "Destination position or position pattern.", "default": "1" }, "relative": { "type": "boolean", "description": "Interpret the destination relative to the source, in modes supporting this.", "default": false }, "backwards": { "type": "boolean", "description": "Resolve positions from the end.", "default": false }, "regularexpressions": { "type": "boolean", "description": "Regex matching for position/count patterns.", "default": false } }, "description": "Moves a segment within a filename. This is unrelated to batch mode move, which moves files to a destination folder." }, "swap": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "separator", "occurrence" ], "properties": { "methodname": { "const": "swap", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "condition": { "$ref": "#/$defs/condition", "description": "Optional per-item condition." }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "separator": { "type": "string", "minLength": 1, "description": "Required. Exact separator.", "default": "" }, "occurrence": { "type": "integer", "minimum": 1, "maximum": 10, "description": "Required. Which separator occurrence to use, 1–10.", "default": 1 } }, "description": "Swaps the text before and after a separator in the selected name portion." }, "renumber": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "numberposition", "change", "zeropad" ], "properties": { "methodname": { "const": "renumber", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "condition": { "$ref": "#/$defs/condition", "description": "Optional per-item condition." }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "numberposition": { "type": "integer", "minimum": 1, "description": "Which numeric sequence in the selected portion to change, counting from 1.", "default": 1 }, "change": { "type": "string", "enum": [ "absolute", "relative" ], "description": "absolute assigns a sequence by list position; relative adds to the existing number.", "default": "absolute" }, "newnumber": { "type": "integer", "description": "Starting value for absolute renumbering.", "default": 1 }, "numberdifference": { "type": "integer", "description": "Amount added for relative renumbering; can be negative.", "default": 1 }, "skip": { "type": "integer", "description": "Step for absolute renumbering.", "default": 1 }, "zeropad": { "type": "string", "enum": [ "auto", "manual", "no" ], "description": "auto, manual, no.", "default": "auto" }, "numberlength": { "type": "integer", "minimum": 1, "description": "Minimum number length with manual padding.", "default": 3 }, "negativenumbers": { "type": "boolean", "description": "Recognize a preceding minus sign as part of a number.", "default": false } }, "allOf": [ { "if": { "properties": { "change": { "const": "absolute" } } }, "then": { "required": [ "newnumber", "skip" ] } }, { "if": { "properties": { "change": { "const": "relative" } } }, "then": { "required": [ "numberdifference" ] } }, { "if": { "properties": { "zeropad": { "const": "manual" } } }, "then": { "required": [ "numberlength" ] } } ], "description": "Changes an existing numeric sequence. To introduce a new counter into a name, use newname or add with an increment tag instead. Names without the chosen sequence are unchanged. List order affects absolute renumbering. To change padding without changing numeric values, use change relative, numberdifference 0, zeropad manual, and the desired numberlength." }, "list": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "newnames" ], "properties": { "methodname": { "const": "list", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "newnames": { "type": "string", "description": "Newline-separated names, e.g. \"First\\nSecond\\nThird\". It is a string, not a JSON array.", "default": "" } }, "description": "Assigns one replacement name per item in list order." }, "listreplace": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "replace", "replacewith" ], "properties": { "methodname": { "const": "listreplace", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "condition": { "$ref": "#/$defs/condition", "description": "Optional per-item condition." }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "replace": { "type": "array", "items": { "type": "string" }, "description": "Search patterns. Unlike replace in the single Replace method, this is an array.", "default": [] }, "replacewith": { "type": "array", "items": { "type": "string" }, "description": "Corresponding replacements. Use the same number of rows as replace. Equal array lengths require a separate check.", "default": [] }, "casesensitive": { "type": "boolean", "description": "Case-sensitive matching.", "default": false }, "regularexpressions": { "type": "boolean", "description": "Regex matching.", "default": false } }, "description": "Applies multiple replacement rows to each selected item, in row order." }, "script": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "script" ], "properties": { "methodname": { "const": "script", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "applyto": { "type": "string", "enum": [ "name", "extension", "nameandextension" ], "description": "Select the current basename without its final extension (name), the extension without its leading dot (extension), or the full filename (nameandextension). Selecting name preserves the current extension.", "default": "name" }, "script": { "type": "string", "description": "Per-item JavaScript method body returning the new selected name portion. Empty input falls back to the default. Keep JavaScript inside a JSON string with quotes and newlines escaped.", "default": "return item.newBasename;" }, "prescript": { "type": "string", "description": "Pre-batch JavaScript.", "default": "" } }, "description": "Executes an Advanced Renamer JavaScript method. Use ordinary methods when they express the task clearly." }, "timestamp": { "type": "object", "additionalProperties": false, "required": [ "methodname", "active", "applyto", "change" ], "properties": { "methodname": { "const": "timestamp", "description": "Exact method identifier from the sections below." }, "active": { "type": "boolean", "description": "Required. Execute this method.", "default": true }, "description": { "type": "string", "description": "Optional method description.", "default": "" }, "applyto": { "type": "string", "pattern": "^(created|accessed|modified)(,(created|accessed|modified))*$", "description": "One or more comma-separated targets: created, accessed, modified; e.g. \"created,modified\". This is not a JSON array. Generated projects require at least one target.", "default": "" }, "change": { "type": "string", "enum": [ "created", "accessed", "modified", "image", "absolute", "relative", "filenamepattern", "dirnamepattern", "now", "metadata" ], "description": "created, accessed, modified, image, absolute, relative, filenamepattern, dirnamepattern, now, metadata.", "default": "absolute" }, "year": { "type": "integer", "description": "Absolute year or relative year adjustment.", "default": 0 }, "month": { "type": "integer", "description": "Absolute month or relative month adjustment.", "default": 0 }, "day": { "type": "integer", "description": "Absolute day or relative day adjustment.", "default": 0 }, "hour": { "type": "integer", "description": "Absolute hour or relative hour adjustment.", "default": 0 }, "minute": { "type": "integer", "description": "Absolute minute or relative minute adjustment.", "default": 0 }, "second": { "type": "integer", "description": "Absolute second or relative second adjustment.", "default": 0 }, "pattern": { "type": "string", "description": "Date/time extraction pattern for pattern modes. Empty input also gets this default.", "default": "<Year>-<Month>-<Day>" }, "metadatafield": { "type": "string", "description": "Metadata field identifier for change: \"metadata\".", "default": "" } }, "allOf": [ { "if": { "properties": { "change": { "const": "absolute" } } }, "then": { "required": [ "year", "month", "day", "hour", "minute", "second" ] } }, { "if": { "properties": { "change": { "enum": [ "filenamepattern", "dirnamepattern" ] } } }, "then": { "required": [ "pattern" ] } }, { "if": { "properties": { "change": { "const": "metadata" } } }, "then": { "required": [ "metadatafield" ], "properties": { "metadatafield": { "type": "string", "minLength": 1 } } } } ], "description": "Changes file timestamps, not the text of the filename. Renaming a file from a date tag is usually a newname task instead. For absolute changes, provide a valid complete date and time; relative offsets may be negative or zero." } }, "$comment": "Default annotations describe application JSON loading behavior, including empty-string fallbacks; they do not insert values or relax required fields and authoring constraints. Some loading defaults are intentionally unusable in generated projects." } ```