I have a question regarding the activation of applications.
I use Keyboard Maestro for all my custom made shortcuts. I use quite a few and sync them across three machines. Now I want to use different main browsers on the systems which I want to activate with the same shortcut (for example cmd + 2 should open the main browser on all my systems which is Firefox on one system and Vivaldi browser on the others). I tried to use a symbolic link to achieve that, but keyboard maestro seems to follow the link on macro creation and uses the full path to the linked application when the macro is executed instead of using the symbolic link each time the macro is executed.
Does anybody have an idea on how to achieve it, to activate a different browser with the same shortcut on several synced machines?
That would be a nice idea, but it would open a new tab each time. I realize that I have to add some more information to describe my use case better. I have the following settings associated with my shortcut:
I use it all the time, sometimes several times per minute, to switch between code editor, browser and terminal. So opening a new tab would be uncomfortable.
But thanks to your suggestion I got another idea. I will use apple script to open my symlink app. That would use the symlink on each macro activation and therefore survive the sync and work on my other machines as well. This is my solution:
To make that macro work you have to create a symlink in the application directory to the application that you want to open with your terminal application:
ln -s /Applications/main_browser.app /Applications/Firefox.app
use framework "Foundation"
property this : a reference to current application
property NSWorkspace : a reference to NSWorkspace of this
property NSURL : a reference to NSURL of this
set sharedWorkspace to NSWorkspace's sharedWorkspace()
set www to NSURL's URLWithString:"http:"
set AppPath to (sharedWorkspace's URLForApplicationToOpenURL:www) as text
activate the application named AppPath
What about having a tiny URL file in your synced folder, and starting the macro by opening that file...which would then bring your preferred browser to the front?
Wow, that is awesome. Way less configuration without maintaining an extra symlink on each device. Thank you for this script! This one is in use from now on!