How to rename an open file on Mac
You can do this with Note My, without closing the tab or going out to the Finder and back. Here is which of the two rename commands touches the disk, and what happens to unsaved edits when you use each one.
You are half an hour into a file called untitled 2.txt, or something you typed with the wrong extension. You want to fix the name without closing the tab or going out to the Finder and back.
Note My has two rename commands. They have similar names, they sit in different places, and each is built for a different job. Two minutes here and you will know which one to reach for every time.
Two commands, two jobs
The short version: one renames the file where it already lives, the other is a deliberate move-and-rename that can put the file anywhere.
| Inline rename | Rename File… | |
|---|---|---|
| How you reach it | Double-click the tab title, or Rename… in the tab's context menu | File ▸ Rename File…, or the toolbar's Save As pull-down |
| Where the file can end up | The same folder it is already in | Any folder you choose, through a save panel |
| On a document never saved to disk | Changes the tab label only — nothing is written | Ready as soon as you save the file |
| If a file of that name is already there | Replace… or Cancel | Replace…, Choose Another Name or Cancel |
| If you have unsaved edits | Renames straight away; your edits stay put in the tab | Asks: Save and Rename…, Rename Without Saving or Cancel |
| Best suited to | A quick correction to the name, in place | A rename and a move made together |
Both routes sit within reach of the document you are looking at: the tab title for a rename in place, and the File menu — mirrored in the toolbar's Save As pull-down — for a rename that also moves the file. Either way you stay in the window you are working in.
Rename the file you are looking at
-
Decide whether the file is moving
If the name is wrong but the folder is right, the inline rename is the faster route. If the file also belongs somewhere else — a scratch file that should be in the project — use File ▸ Rename File… and do both in one step.
-
Rename in place: double-click the tab title
Double-click the title on the tab itself. It becomes an editable field with the current name in it. Type the new one and commit it by clicking anywhere outside the field.
The file keeps its folder. The inline rename changes the name and nothing else, which makes it the quick, safe option. You can also reach the same rename from the tab's context menu — right-click or ⌃-click a tab — where it appears as Rename… among the other tab commands.
-
Rename and move: File ▸ Rename File…
Choose File ▸ Rename File…. A save panel opens, so you get the full Finder-style folder chooser: pick the destination, type the name, confirm. This is the command to use when you mean to move the file, and it is deliberately the one that asks more questions.
The same item also lives in the toolbar's Save As pull-down, alongside Save, Save a Copy As…, Reload from Disk and Reveal in Finder — so you do not have to go to the menu bar for it.
-
Answer whatever it asks
Two prompts can appear, both covered below: one when the document has unsaved changes, one when something of that name is already at the destination.
Either way the tab stays where it is, with your cursor and scroll position untouched. The new name is the one you will see the next time you open the app — our auto-recovery safety net keeps your tabs waiting for you. A name you start typing and abandon is never kept — only the one you commit. All of it stays on your Mac: nothing is uploaded, and there is no account.
Renaming with unsaved changes
The inline rename goes straight through. A document with unsaved edits is renamed the moment you commit the name, with no sheet in the way. Your edits stay exactly where they were, still unsaved in the tab, and the leading * on the tab title is still there afterwards, because nothing has been saved yet. Press ⌘S when you are ready.
Rename File… checks with you first. It is a move as well as a rename, so it puts a three-way choice in front of you: Save and Rename… saves your changes first and then moves the file; Rename Without Saving moves the file and leaves your edits unsaved in the tab; Cancel does nothing.
Neither rename discards your unsaved edits. Our auto-recovery safety net looks after unsaved work tab by tab and brings it back if the app or your Mac stops unexpectedly. It is always on, and everything it keeps stays on your Mac.
When a file with that name already exists
Renaming onto an existing file is destructive, so it is confirmed — and the two commands confirm it differently.
The inline rename offers two buttons, Replace… or Cancel. Choosing Replace puts the existing file at that name in the Trash, so what you displaced is recoverable rather than gone.
File ▸ Rename File… offers three: Replace…, Choose Another Name or Cancel. The extra button matters more here, because you may have just navigated into an unfamiliar folder and the collision is your first hint that anything was there.
Renaming a tab that has never been saved
A new document has no file behind it yet. Creating one with ⌘N leaves nothing in the Finder until you save, although our auto-recovery safety net looks after what you type from the first keystroke.
So on an untitled tab the inline rename names the tab and leaves the disk alone until you say otherwise. It is worth doing early: tabs called notes, query and reply beat three called untitled. Treat it as a label for yourself, and let the save be the moment a file appears. File ▸ Rename File… and the other File-menu items that act on a file on disk come alive as soon as that tab has one behind it.
To give that tab a real file, use ⌘S or ⇧⌘S. Save As pre-fills an extension to match the language you are writing in, chosen by our advanced language identifier, so the file you save reopens with the same colouring you had while writing it. Type over the suggestion if you want a different one.
Changing the extension
Both renames accept a change of extension; nothing stops you turning run.txt into run.py or script into script.sh. The extension is worth getting right all the same, because it is the part of the name the file carries with it. A file called run.py is read as Python by our advanced language identifier every time it opens, and our syntax engine colours it from the first line — on this Mac, and on any other you open it on. Name a file for what it holds once and you never think about it again.
Some names need no extension at all — Makefile, Dockerfile, .env, .gitignore. Those are known by name rather than by suffix, and they settle into Plain Text, which is the right home for a build file or a config: it opens ready to edit, and no smart quote, dash or autocorrect is ever allowed near what you type there — a curly quote in a Dockerfile would break it outright. So keep the name the file is supposed to have; renaming it to please the editor is never the price of working on it.
The status bar is where you read the result: the Identify pill names the language the tab is in, so a glance down tells you what you are looking at without opening anything.
To put a language on the tab you already have open, click the Identify pill. That opens the Language Inspector — "Identified programming language: X", a pop-up to choose a different one, and Confirm or Cancel. Everything that language carries — colour, completion keywords, comment markers, the document symbol list — arrives in the same moment you confirm, and your choice sticks for that tab, so you are not asked about it again.
Renaming while recording a macro
Our macro recorder captures the inline tab rename, along with typing, paste, navigation, selection, find, replace, Go to Line, save, encoding conversion, line-ending conversion and bookmarks — so a rename can be part of a routine you repeat. Start with ⌥⌘R, stop with ⌥⇧⌘R, play back with ⌥⌘P.
When a rename belongs inside a run you play back, reach for the tab title. Record the double-click and the new name once and it takes its place in the sequence like any other step, so a rename can sit in the middle of a longer routine — find, replace, rename, save — and come out the same way each time you play it.
That is worth knowing if the same handful of steps comes round often. A file you tidy the same way each morning — a couple of replacements, a rename, a save — becomes one playback rather than a sequence you repeat from memory. It all happens on your Mac, on the file you opened yourself.
Troubleshooting
Rename File… is greyed out
The active tab is still untitled, so the File menu's disk actions are waiting for a file to act on. Save it once with ⌘S and the whole family — Rename File…, Duplicate File…, Reveal in Finder, Copy Path, Move to Trash… — comes to life together, on that tab and on every tab you save from then on.
The tab title changed but the file did not
Same cause, seen from the other side: you used the inline rename on an untitled document, which names the tab and leaves the disk alone. File ▸ Reveal in Finder is the quickest test — once that item is live, the tab has a file behind it and both renames act on disk from then on. Press ⌘S, give it the name you want, and you are there.
The rename appears twice in a recorded macro
Your file is renamed once, to the name you typed, and playback lands on the same result either way. For a recording as short as the routine it describes, commit an inline rename by clicking outside the title field rather than pressing Return while our macro recorder is running. Record it that way once and the step reads cleanly every time you come back to the macro.
The tab you renamed is still in Plain Text
Open the Language Inspector from the status bar's Identify pill and choose the language you want. The tab is coloured the moment you confirm, and the choice holds for as long as that tab is open. The same click is the answer for a file whose extension is unusual for the language inside it, and for a snippet you pasted into a fresh tab. Give the file the usual extension for its language while you are renaming it and it arrives coloured on its own every time after that.
I renamed the file in the Finder instead, and now the tab is complaining
Rename or move a file in the Finder and the tab holding it loses track of the original. You are told once, calmly — "«X» was deleted from disk." — with Keep in Editor or Close Tab. Choose Keep in Editor and the version in front of you is the one that counts; save it and you decide where it lands. Renaming from inside the app avoids the situation.
Files you reach from the Finder
A file you have spotted in a folder is a click away from the tab where you would rename it. Note My puts its own menu in the Finder's right-click: open a selection in the app, put two files side by side in our comparison view, concatenate several into one document, or copy paths straight to the clipboard. Open the file that way, rename it from the tab title, and the whole round trip takes a few seconds.
Find in Folder works from the other direction. Search a whole folder from inside the app, open a result in a tab, and rename it there once you can see what it actually contains — often the moment you discover the name was wrong in the first place. The search itself reads the files and never writes them, so you can cast a wide net across a folder knowing nothing in it changes until you decide to change it.
When a copy is what you want
If what you want is a second copy rather than a new name, three other commands fit better: File ▸ Save a Copy As… (⌥⇧⌘S) writes a copy and leaves the tab on the original, File ▸ Duplicate File… copies the file on disk, and File ▸ Duplicate Tab (⌃⌘D) gives you a second tab.
The difference between them is what you are left looking at. Save a Copy As… files a snapshot somewhere of your choosing and leaves you typing in the original, which is the one to reach for before a change you are not sure about. Duplicate File… gives you a sibling on disk, ready to diverge from the first. Duplicate Tab is the quickest of the three when all you want is another tab to work in. In each case the file you started from is left exactly as it was.
Frequently asked questions
Does renaming save my unsaved changes?
Only if you ask it to. The inline rename renames the file and leaves your edits exactly as they are, still unsaved in the tab and ready for ⌘S when you want them written. File ▸ Rename File… asks explicitly, and Save and Rename… is the option that writes first.
Can I rename a file and move it in one step?
Yes — that is exactly what File ▸ Rename File… is for. It opens a save panel, so you choose the destination folder and the new name together, and the tab follows the file to its new home.
What happens to the file I replace?
With the inline rename, choosing Replace… puts the existing file at that name in the Trash, so it is recoverable. Rename File… adds a Choose Another Name button so you can back out of the collision without replacing anything.
Can I rename a document I have never saved?
You can name it straight away: double-click the tab title, type the name you want, and the tab carries it while you work. The disk is left alone until you are ready. Use ⌘S or ⇧⌘S to give it a file — the save panel pre-fills an extension that matches the language you are writing in, so the name you chose and the file you get agree with each other.
What is the quickest way to start a rename?
Double-click the tab title. The name becomes an editable field in place, you type over it, and a click outside commits it — all without leaving the document you are in. For a rename that also moves the file, File ▸ Rename File… is in the File menu and in the toolbar's Save As pull-down.
Where does a rename happen?
Entirely on your Mac. Note My contains no networking code of its own; the only network activity is performed by Apple’s own system services, to establish purchases and transactions state. There is no telemetry, no update checker and no account to create. A rename happens on your Mac, on a file you chose yourself, and nothing about it is uploaded anywhere.