Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Finder > Select a folder > Right click, we get a popup with an option to create a new folder:

enter image description here

Is there a way to add menu item New Textfile for adding a new text file?

share|improve this question
up vote 10 down vote accepted

You could assign a shortcut to a script like this:

tell application "System Events" to tell process "Finder"
    value of attribute "AXFocusedWindow" is scroll area 1
end tell
tell application "Finder"
    if result is true or number of windows is 0 then
        set t to desktop
        set t to target of Finder window 1
    end if
    set f to make new file at t
    if t is desktop then
        set selection to f
        select f
    end if
end tell

There is a bug in 10.7 and 10.8 that affects many other scripts and Automator services like this. Finder ignores new windows when getting the insertion location and selection properties. If you open a new Finder window, select some items in it, and run tell app "Finder" to selection in AppleScript Editor, the result is the items selected in some window behind the frontmost window (or an empty list). One workaround is to move focus to another application and back, but it results in a visual glitch.

So neither of these ways of checking if the desktop is selected work reliably:

tell application "Finder"
    insertion location as alias is desktop as alias
    container of item 1 of (get selection) as alias is desktop as alias
end tell

You could also wrap the script as an Automator service, but there is another bug where the shortcuts for Automator services don't always work until you hover over the services menu from the menu bar. If the input type was set to no input, the service wouldn't show up in context menus. If it was set to folders or files, you'd have to always secondary-click some folder or file.

Related questions:

I didn't vote to close this question, because many of the solutions in the other questions are affected by either of the two bugs mentioned above. We'll likely get even more questions like this, which could then be closed as duplicates of this question.

share|improve this answer
this is so dumb its not default – SuperUberDuper Feb 11 at 16:38

I am using XtraFinder plugin for Mac OS's built in Finder. It has most of the features including create new file in finder options.

You'll love it like I do


share|improve this answer
Nice app! Didn't know it, it has a tons of extra features! Thanks for the suggestion! – Zequez Feb 26 '15 at 3:35
you're welcome! – rbncha Feb 27 '15 at 4:58
Ace, add your own file templates – ptim Sep 8 '15 at 14:53
Dude. Thanks so much for introducing me to that app. Amazing. – user38217 Sep 16 '15 at 2:23
You are welcome :) – rbncha Sep 16 '15 at 7:07

Edit: I couldn't get the above working as a Service but then I found a dialog hiding behind everything else where Finder was asking for permission to use the accessibility features. Once I'd enabled that the answer from Lauri Ranta worked. But the one below works well and doesn't need extra permissions.

I've tried several ways, the cleanest I've found is the Automator script provided here:

And available from Github here:

share|improve this answer
This works great. – Camden S. Jan 22 '14 at 19:05
This works. The instructions say to open it and hit cmd + s but that did nothing for me. I'm on Mavericks and when opening it, I was prompted to either install or open. I had choose to install it in order for it to work. – Justin Mar 7 '14 at 21:31

There is a little known feature of the Finder called Stationary Pad. Imagine having a pad of paper that you could "tear off" a new sheet from on your desktop. Each page in the pad could have a custom layout and pre-existing content etc, allow you to (for example) fill in a "while you were out, X called" memo.

I'm not as a Mac at present to get screenshots etc, but if you open up a text document, and then enter the details you want to be used as your template (bearing in mind a totally blank sheet is a perfectly valid template), then save it somewhere, right click and Get Info, then click the Stationary Pad tick box, then that file will subsequently behave differently from a normal file. Double clicking to open the file will actually open a copy of the file, without any filename set, as if it were a totally new document, allowing you to fill it in and save it with a name/location of your choosing. The great thing about this is that without unticking the stationary pad option, you cannot accidentally overwrite or otherwise modify the original template.

There is more info if you google, this is a brief summary with helpful commens that isn't too old.

This isn't quite right clicking on the desktop and clicking "New File", but if your template icon is on the desktop it's arguably faster (depending on if you are faster at locating an icon and double clicking, or using any white space, right clicking then choosing from a context sensitive menu...)

Alternatively, you could use a combination of one of the scripted methods shown in other answers to get them to simply open a Stationary pad file, and you can recreate the "create blank" feature nicely from any App, even ones that don't support Applescript, and the "blank" document doesn't even have to be blank, but can be a template.

share|improve this answer
At first glance, this doesn't work on Mavricks, does it? – Camden S. Jan 22 '14 at 19:05
Trying this on Mavericks, it doesn't work quite as advertised in this answer. It copies the file and opens that new copy right away, not bringing up an option to choose the file name before you start editing it. (and indeed, opening it which you may not want if you just want to create and name the new file.) – user46942 Mar 3 '14 at 22:51
As per "Double clicking to open the file will actually open a copy of the file, without any filename set, as if it were a totally new document, allowing you to fill it in and save it with a name/location of your choosing." perhaps my wording isn't great, I'm not suggesting you get the chance to select the filename at this point, by fill in I mean't "write stuff in your document or fill in your template etc". Hope this clear things up. – stuffe Mar 4 '14 at 15:22
This is interesting to know! However for me, I need to be able to create a new text file anywhere, rarely on the Desktop :) – RedYeti Mar 8 '14 at 10:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.