MacOS – How to create a keyboard shortcut to access a specific folder in Finder

finderkeyboardmacosuti

I have been using Total Commander as a file manager on Windows for years. There is one feature I miss a lot in Finder: a shortcut to one specific folder.

Saying I have a folder ~/Downloads, ~/Dropbox, ~/Code, ~/Books.
Is it possible to setup a customized keyboard shortcut for each of them?

In Total Commander you could do ctrl+D+1/2/C/B/… etc.

Best Answer

One option would be to create an Automator service and assign it a shortcut in the Keyboard preferences.

tell application "Finder"
    reopen
    activate
    set p to (system attribute "HOME") & "/Downloads/"
    set target of Finder window 1 to POSIX file p
end tell

You could also save the script to ~/Library/Scripts/Applications/Finder/ with AppleScript Editor and use FastScripts to assign the shortcut.