Rename open files

What do you do if you’re working on a document, and decide you’d really like to rename it? One option is to use File -> Save As to create a new file with your desired name, and then switch to the Finder and delete the old version of the file. You can also close the file, switch to the Finder, rename the file, and then reopen it.

While both these methods work, in many programs there’s a third option: you can just rename the file while editing it. This trick has worked in the Mac OS for many years, but not everyone knows it’s possible. Note that this trick may not work in every application, so it falls into the ‘try it with a test file first’ category.

For now, try it with TextEdit. Create a new document, put some text into it, and name it My test file. Leave the file open in TextEdit, and then rename it. You could do this by switching to the Finder, navigating to where you saved the file, then renaming it there. But you can use another old Mac OS trick to simplify the process.

Command-click (in OS X 10.5, you can also use Control-click) on the file name in the TextEdit window title area, and a drop-down menu will appear showing the path to the saved file. Select the folder containing the saved file from the drop-down menu, and that folder will open in the Finder.

Now rename the file and switch back to TextEdit. Notice that the file name in the window title area reflects the new name. That’s all there is to it. If you’re curious as to why this works, it’s because well-written Mac OS applications track files by their reference (a pointer to their storage location) instead of by their path (which would include the file name). A renamed file has the same reference as it did under its previous name, but its path will be different.

While this won’t work in all applications, it does work in many, and can be a nice little time-saver when you need to rename the file you’re currently working with. Thanks to Mac OS X Hints reader calitinilo for reminding me of this long-standing Mac OS feature.

Shop Tech Products at Amazon