Increment Numbers in Filenames in 10.5's Finder

As you probably know, there are many ways to duplicate files in the Finder. You can copy (Command-C) and paste (Command-V), Option-drag the file, or Control-click on the file and choose Duplicate from the contextual menu (or just press Command-D).

In the OS X 10.5 Finder, however, the naming of the copied file varies depending on which of the above methods you use to copy the file (this only works in 10.5, though). If you use Command-D (or Duplicate), or copy and paste, then Finder will append copy to the end of the filename. If the file's name already ends in copy, Finder will then append a number to differentiate the copied file.

However, if you Option-drag the file, Finder will treat it differently, depending on how it was originally named. If the file's original name ends with a word, or a word-number combo (i.e. somefile or somefile5), then Finder will append a number (instead of appending copy). However, if the file's name ends with a number that stands apart from the file's name, then Finder will increment that number--so somefile 5 will become somefile 6 when you use Option-drag to create the copy.

You can use this little trick whenever you want to duplicate a file--or many files--and increment their filenames. Just select all the files, Option-drag them, and the duplicates will be created with incremented numbers in their filenames. Thanks to Mac OS X Hints reader ecbtln for submitting this interesting tidbit about copying files in the OS X 10.5 Finder.

Shop ▾
arrow up Amazon Shop buttons are programmatically attached to all reviews, regardless of products' final review scores. Our parent company, IDG, receives advertisement revenue for shopping activity generated by the links. Because the buttons are attached programmatically, they should not be interpreted as editorial endorsements.

Subscribe to the Best of TechHive Newsletter