System-wide hotkey to focus NC
System-wide hotkey to focus NC
What do you think about an option for a system-wide hotkey to put NC into focus? I'm thinking something like Win+E for Explorer in Windows. I always found this very useful and it's quicker than Cmd+Tab when there's a lot of open apps. A good example in OSX would be iTerm2.
Re: System-wide hotkey to focus NC
Cool idea. Until there's a solution, you can do this yourself with a Service: open Automator > New > Service > no input + any application > run AppleScript OR run Shell Script:OR > save the Service, give it a nice name, then go to Services Preferences, find your new Service in the long list, and then define a keyboard shortcut for it; it will be available system-wide, so you need to check that there aren't any conflicts; you can use apps like CheatSheet for that. (My suggestion: keyboard shortcuts using CTRL+ALT+CMD plus a key are probably the safest to use.)
In AppleScript there's also a way to bring an app to the foregroundbut that will only work, if NC is already running, so you need the activate command too (see above).
The only downside is that macOS Services are a little slow; the fastest way would be to do it with an app extension, that only registers a system-wide keyboard shortcut, either directly from within the Nimble Commander bundle (that would be something for mike to develop eventually), or with a third party app extension that just addresses NC and brings it to the front (this you could do yourself, if you know Objective-C or Swift).
Code: Select all
tell application "Nimble Commander" to activate
Code: Select all
osascript -e 'tell application "Nimble Commander" to activate'
In AppleScript there's also a way to bring an app to the foreground
Code: Select all
tell application "System Events" to set frontmost of process "Nimble Commander" to true
The only downside is that macOS Services are a little slow; the fastest way would be to do it with an app extension, that only registers a system-wide keyboard shortcut, either directly from within the Nimble Commander bundle (that would be something for mike to develop eventually), or with a third party app extension that just addresses NC and brings it to the front (this you could do yourself, if you know Objective-C or Swift).
Re: System-wide hotkey to focus NC
I like this idea.
However, I don't think it'll be wise to put this functionality inside NC itself, since MAS-versions of NC cannot intercept keystrokes (Hello, Apple's sandbox ideology!), thus this feature will be crippled by design.
Said that, I can write a tiny separate app, that will do just that - catch keystroke, compare it with defined hotkey and set focus to defined application.
BTW, aren't plenty of such solutions available already?
However, I don't think it'll be wise to put this functionality inside NC itself, since MAS-versions of NC cannot intercept keystrokes (Hello, Apple's sandbox ideology!), thus this feature will be crippled by design.
Said that, I can write a tiny separate app, that will do just that - catch keystroke, compare it with defined hotkey and set focus to defined application.
BTW, aren't plenty of such solutions available already?
Re: System-wide hotkey to focus NC
Cool!
I think a "NC helper" app just for this case would be overkill. I'm using global hotkeys for apps like Things, iTerm2 or Little Snitch, they all have a shortcut recorder in their preferences without a helper app. I wouldn't mind the App Store version not supporting this feature, and this wouldn't be the only difference to the non-MAS version.
You're right, it's easy to set up with third party tools. I've settled for a BetterTouchTool shortcut running the aforementioned AppleScript line almost instantaneous, much faster than using Services. Probably more people would use the feature if it was possible to set up in NC's preferences, as with the other apps I've mentioned. But no need to rush, this is certainly something that can wait a release or two