I’m finding it difficult to get most automation apps to replicate a command-tab keystroke. I’d like a button on my stream deck to switch to firefox, reload the page, then return to the previous action. It seemed easy enough,
- Open Firefox
- Send keypress command R
- Send keypress command Tab
However, getting most tools to recognize the command-tab instead of sending it was nearly impossible. Since Keyboard Maestro would let me set the keystroke manually instead of listening, but I couldn’t find a way to trigger that script with the streamdeck as the end of a multi action, I was able to kludge it together by having the last action ont he streamdeck button fire a shortcut that triggers a keyboard maestro macro to send command tab. Is there a way to do this that doesn’t involve passing through three apps to send command tab?
Instead of calling Keyboard Maestro via Shortcuts, you could do it directly with a URL scheme call (using an open website action), as well as the more complex command line or AppleScript calls. You could also utilise a Keyboard Maestro or KM Link step to trigger it if you have installed either of those plugins (and if you haven’t, you should).
That gets you down to the Stream Deck software calling Keyboard Maestro - so just two apps. The app that is controlling your hardware, and the app that is sending your keypress.
My advice would be to put all three steps in a single Keyboard Maestro macro and call that in a single step from the Stream Deck. That will give you the advantage of if you ever want to reuse it as part of a larger automation, or even something not triggered by the stream deck, you have a single source for your automation steps that can be triggered from a myriad of places.
For completeness, if you have Better Touch Tool (which has two types of Stream Deck support), that is another app that can send CMD+TAB. I use this rather than the Stream Deck software currently, but I frequently use it to trigger a Keyboard Maestro macro. I would imagine >90% of my Stream Deck actions are centralised to Keyboard Maestro.
I use Keyboard Maestro extensively with my Stream Deck. I would go with sylumer’s suggestion of just letting Keyboard Maestro do all the heavy lifting. I only use Keyboard Maestro’s own plug-in with the Stream Deck. It take more time to learn vs. the other plug-in, but when the latter stopped working I just dumped it and went all-in with KM. The fact that KM lets you modify the icon on the button, as well as the text on the button, on the fly, you can do all sorts of things to make automating with KM a no-brainer.
Before we start, you should know that I am shameless*.
Every now and then I am going to pop up and say, “Well you can struggle with the Elgato software to get it somewhere close to what you want. Or you can strap on your big-boy pants and dive in with Better Touch Tool.”
Not for the faint of heart. But lots lots more control. And if you are reading this on the Automators forum, you might be ready.
*“Shameless” in that I only promote the BTT/Stream Deck combo so that enough people jump into the pool so Andreas ends up spending more time developing it.
Which is good for me.
If you are using Keyboard Maestro, you could just use the Select a Menu Item action to select Reload (I presume Firefox has a menu for this), in Firefox, and it would handle the application switching for you.
I tried your “Big Boy Pants” solution and hated it. I find Keyboard Maestro to be way better for the way I work. I don’t like multi-gestures on touchpads and such stuff. It’s just too much to remember and too finicky for my taste. To each their own.