Rename Macro Language

Although you don’t need to understand the rename macro language (using the macro builder is much easier!), it’s described here for reference.

The macro language describes one or more operations, each with a position relative to either the beginning or end of each filename. Above is a simple macro that removes 6 characters from the end of each name, and inserts the word “Final” at the start of each name.

The components of each macro expression are:

  1. Anchor: The first character of operation macro is either an L or an R, to indicate whether the position is relative (anchored) to the left or right of the filename.

  2. Offset: Next is the offset in characters from the anchor position.

  3. Operation: (Optional) One of the following operation characters can appear next.

  4. Length: For(remove), C (copy) and X (cut), the length in characters to cut, copy or remove is next. You can use * for the length to signify to the end of each name (however long that is).

  5. Insert: (Optional) To insert characters at the current position in the name, use a + followed by the text to insert.

  6. Separator: If the macro contains additional operations they should be separated by a / character.

 

Using this information we can now decode the macros shown in the above example:

And here’s an example of this macro in action:

As you can see, the suffix _draft was removed from each filename (by the R0-6 expression) and the prefix Final was inserted (by the L0+Final expression).

 

Let’s have a look at a more complicated macro example.

Using the guide on the previous page, we can break this down and decode each component as follows:

 

As you can see, this macro makes use of the clipboard functionality of the macro language. Clipboard operations are performed on a per-filename basis – when it says “cut 2 characters to the clipboard”,  that means in each filename two characters – potentially different for each file – are cut to the clipboard. What this means of course is that you can move parts of filenames around using simple clipboard operations.

 

Here’s an example of this macro in use:

Like the first example, the suffix _draft was removed from each filename (by the R0-6 expression) and the prefix Final was inserted (by the L0+Final expression). But as well as that, the date in each filename has been rearranged. Using multiple clipboard cut / insert steps, 2007-10-15 has been turned into 15.10.2007.