MacOS – How to bind a key in OSX to open a new window of an application

keyboardmacosspaces

I can't find a way to do this. There's only binding to open an application. But the apps I want to use this on, (chrome, terminal, and finder) are always open. I just want to open a new window in the current work space.

I can Command + Tab then hit Command + N. But Command + Tab can change my workspace if a window of that app is already opened in another work space.

Best Answer

There's no single way to open a new window with AppleScript, but make new window or make new document works in many applications.

tell application "Google Chrome"
    make new window
    activate
end tell    
tell application "Finder"
    make new Finder window
    activate
end tell
tell application "Terminal"
    do script ""
    activate
end tell
tell application "TextEdit"
    make new document
    activate
end tell

You can assign shortcuts to scripts with applications like FastScripts or Alfred.

You can also open new windows from the Dock: