JPT Icon

Using Insertion Variables

NtF! allows you to enter some special variables into the prefix or suffix that will be transformed when the new item names are generated. These variables include dates, counters, and the name of the enclosing folder of the item itself. The easiest way to use insertion variables is to use the corresponding insertion menu to the right of either the prefix or suffix field. When you use the insertion menus to place a variable, the variable will be included in either your prefix or suffix but it will be delimited by “«” and “»” (e.g., «#»). You can manually enter insertion variables but if you don’t include the double angle brackets (Option-\ and Option-Shift-\), then NtF! won’t know that these are insertion variables and will treat them as literal characters. Again, it’s easiest just to use the insertion menus.

A counter is an auto-incremented value that can be included in either the prefix or suffix. This counter gets incremented on each file so, for instance, a counter in the suffix could rename a set of files from “file.jpg”, “file.jpg”, “file.jpg” to “file 1.jpg”, “file 2.jpg”, “file 3.jpg”. The counters can also include leading zeros (which will add the appropriate amount of leading zeros based the total number of files to be renamed, e.g., if there are 10 files and the counter starts at 1, with leading zeros applied, the counter will result in 01, 02, etc.). To insert a counter, use the insert menu to the right of either the prefix or suffix text fields. The counter is the pound sign (#). Once inserted, you can change the counter start number (via the Prefix of Suffix Start Number fields, accordingly), and the increment amount. The defaults are 1 and 1 but you could start at any arbitrary number and increment by any integer amount as well. You can also specify the minimum number of digits that a counter should be which will prepend the appropriate number of zeros to the counter until it is the length specified. If you enter a negative value for the counter increment, the counter will decrease with each name.

To add a date variable, you also use the insert menu to the right of the prefix or suffix fields. The variables will insert the date based on the format of the variable inserted. You could add a hard-coded date to either the prefix or the suffix but a variable is more helpful when you want to save the rename parameters via a Profile. (See the “Saving, Applying & Managing Profiles” help section for more information on Profiles.) When you insert a date, the date that is used will either be the current date, the creation, or the modification date of the item to be renamed. You can use a separate date for both the prefix and suffix as desired. In the preferences, you can enable the option to use the EXIF creation date instead of the Finder creation date. With this option enabled, NtF! will attempt to extract the EXIF data from the item (this is metadata embedded in the file itself by devices such as digital cameras). This is helpful as sometimes the Finder does not include the actual date a file was created but, rather, the date it was first copied to the computer. Please note: if this option was not enabled when you first listed the source folder, you will need to refresh the file list to see the EXIF creation dates. Also, with this option enabled, loading the file list can take significantly longer than when the option is disabled.

If the default date formats are not appropriate for your needs, you can use a custom formatted date string to represent the chosen date. To use this feature, insert the insertion variable «date %Y%m%d» and then you may modify the format string to suit your needs. Note, when using this feature, your insertion variable must still be delimited with double-angle brackets and must start with the word “date” followed by a space (the “%Y%m%d” format string is just an example and does not need to be used). The syntax for the custom date strings is very similar to that used in the standard C library function strftime(). As with strftime, in NtF! you can use punctuation and other characters in the format string. Please be aware, however, that Finder naming conventions are still in effect so do not use forbidden characters such as colons or forward slashes in your format strings — watch out for those colons in time strings, especially things like “%X”. Here is a list of specifiers you may use:

Specifier

Description

%%

a '%' character

%a

abbreviated weekday name

%A

full weekday name

%b

abbreviated month name

%B

full month name

%c

shorthand for %X %x, the locale format for date and time

%d

day of the month as a decimal number (01-31)

%e

same as %d but does not print the leading 0 for days 1 through 9

%F

milliseconds as a decimal number (000-999)

%H

hour based on a 24-hour clock as a decimal number (00-23)

%I

hour based on a 12-hour clock as a decimal number (01-12)

%j

day of the year as a decimal number (001-366)

%m

month as a decimal number (01-12)

%M

minute as a decimal number (00-59)

%p

AM/PM designation for the locale

%S

second as a decimal number (00-59)

%w

weekday as a decimal number (0-6), where Sunday is 0

%x

date using the date representation for the locale

%X

time using the time representation for the locale

%y

year without century (00-99)

%Y

year with century (such as 1990)

%Z

time zone name (such as Pacific Daylight Time)

%z

time zone offset in hours and minutes from GMT (HHMM)

To include the name of the enclosing folder in the item name, use the corresponding insertion menu to the right or either the prefix or suffix fields to insert the “ƒ” symbol.

Copyright © 2004 - 2017 JNSoftware LLC. All Rights Reserved.
All other products mentioned are copyright of their respective owners.
No endorsement of or affiliation with any third-party product or service is implied.