OSX: Setting a global shortcut key to open a new Finder window
Given that the Finder is central to many tasks in Mac OS X, I’m surprised that there is no global keyboard shortcut to call up a new Finder window. Well, that’s not strictly true — there’s alt-cmd-space, which will bring up a new window to start a Spotlight search. But most of the time I want to open my home directory, so I’d rather have a shortcut which jumps straight there.
Googling for the answer to this problem turned up lots of out-of-date suggestions to use Clearsilver and the like, but it seemed to me that a solution could be found using only what OSX provides. And indeed it can. The following has only been tested in 10.6 Snow Leopard.
The basic premise is to create a new Service to perform this task. Because Services are available globally, if you assign a shortcut to one, it should work in any application.
- Open the Automator application, and create a new workflow based on the Service template:
- In the Library pane, select Utilities, then find the action Run AppleScript and drag it into the workflow:
- Replace the line:
(* Your script goes here *)
with:
tell application "Finder"
activate
make new Finder window to home
end tell
- Save under the name “New Finder Window Home” or somesuch. Whatever name you choose, make a note of it. Also bear in mind that if you choose a name that matches an existing menu entry in any application, that menu entry will be selected in preference to yours… if you just call it “New Finder Window”, then when Finder is the active application, its own menu entry by that name (in the File menu) will be chosen when you hit the shortcut key combo. It may be that it will have exactly the same effect, but it depends on how you have Finder configured, so to avoid confusion, give it a more specific name.
- Go to System Preferences > Keyboard > Keyboard Shortcuts > Application Shortcuts. Click the + button to add a new shortcut:
- Enter the exact name that you saved it as earlier (ie New Finder Window Home, if you used the same as me), and your desired shortcut key combo.
- It seems you have to quit System Preferences before the shortcut key will become operational. But it’s not necessary to restart other applications.
You can make the new Finder window open to somewhere other than your home directory by replacing home in the AppleScript with, for example, folder "Applications" of startup disk.
January 11th, 2011 at 9:06 am
Thanks. I think this was an annoying missing feature in Mac os
January 11th, 2011 at 9:15 am
One note you should also select “Your service receives NO Input”.
That will make it universally available
September 6th, 2011 at 5:56 pm
+1 on “Your service receives NO input”. It seems that if you modify that setting after the fact, OS X won’t pick up on the change, so you’ll have to delete it and recreate.
Also, in Lion (and earlier?) there is a new Services section under Keyboard Shortcuts, as pictured here:
http://screencast.com/t/J1HrQzuNSy
August 2nd, 2012 at 6:56 pm
Thanks for sharing this, very handy!
October 30th, 2012 at 12:29 am
Where is this workflow saved? It’s NOT in Library/Services…
October 30th, 2012 at 12:41 am
Guess what? In OSX it IS in the Library – just not the top level Library or the other Library but the hidden Library. My bad.
November 19th, 2012 at 10:02 am
Thanks a lot!
November 20th, 2012 at 1:19 pm
Great tip, thanks a lot
February 16th, 2013 at 6:37 pm
Hey, I’m using mountain lion, but the keyboard shortcut doesn’t work after setting it via system preferences!! When I run the script in automator, it works, then the problem seems to be in setting keyboard shortcut?!? any idea?
April 5th, 2013 at 10:25 am
….or simply hit: alt+cmd+space
April 5th, 2013 at 8:38 pm
@thesmarti – that does nothing on my Mac. What version of OSX are you using? I’m using Snow Leopard; maybe they added it later? Also, is it a *GLOBAL* shortcut like mine, or must you have the Finder selected first?
May 7th, 2013 at 7:35 am
I believe alt+cmd+space was added in Lion. I’m on Mountain Lion and it does the job.
May 12th, 2013 at 4:09 pm
I have the same problem as ToNoY (I’m running 10.8.3): the script works in automator, but the shortcut in system preferences does not. Any suggestions? Thanks!
May 12th, 2013 at 4:09 pm
Also: the alt+cmd+space doesn’t work for me either.
May 27th, 2013 at 8:42 am
I’m on mountain lion but I think this should be the same on previous versions. (but not tested)
Under Keyboard shortcuts panel, you don’t need to add an entry to the “Applications shortcuts” tab. When you built the script in Automator, you used the “Service” template, so the script is automatically available in the “Services” tab under the Keyboard shortcuts panel. Look for it, by default it is active, and you just have to add your shortcut on it. Quit the preferences panel and it should work.
July 27th, 2013 at 3:04 pm
This is very helpful. I’m trying to get Finder to open/activate and go to the folder “Downloads.” Thanks to your script, I’m almost there. However, the program doesn’t appear to be able to find the folder. Here’s the program:
on run {input, parameters}
tell application “Finder”
activate
make new Finder window to folder “Downloads”
end tell
return input
end run
and here’s the error message:
Can’t get folder “Downloads”.
I think this may need a path statement in front of downloads, but I couldn’t figure out how to do that. I tried a tilde in front of the folder name, and that didn’t help.
Any help would be much appreciated!
August 8th, 2013 at 10:48 am
Larry, do this one:
make new Finder window to folder “Downloads” in home
May 14th, 2014 at 3:11 am
Awesome. Great tip.
October 2nd, 2014 at 8:19 am
This is great, but I which for one more addition.
When I set this shortcut, it always open in 1 space. So It does not open an finder window in the space i’m currently working in, but it pops up on the space where the first finder window was made. That is really annoying, so anyone has a idea how to fix this?
May 9th, 2015 at 1:31 am
Well, running the script works. However, the shortcut binding seems to bring up the editor window in Automator for the script, not actually running the script. No idea how to solve that.