{
  "$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."
}
