Triggering Stream Deck Profiles for Logic Pro Plugins


That's really a great stuff!

However for several hours I'm trying to set up a thing out of these macros, and I couldn't get around it. The thing is kind of simple - I just want to trigger a specific Stream Deck profile while changing the Logic's focused window from "- Tracks" to "- Piano Roll" and vice versa. And that's about it. Do you know how to make this work? Any help will be much appreciated!

There's no native way to do this from Keyboard Maestro that I am aware of.

As of right now, the Stream Deck profiles are triggered by application switching only, not window switching.

One way I accomplish switching back and forth quickly between two related profiles is putting a profile switcher button in the same spot on both profiles. So for "Profile 1", I would have a switcher set to go to "Profile 2" in row 1, column 1, and in "Profile 2" I would have the same thing in the same spot but to go to "Profile 1". Obviously it doesn't do anything automatically, but muscle memory is pretty fast and efficient too :wink:

EDIT: I read somewhere about somebody who compiled an AppleScript that did nothing, saved it as an application package, and used that "blank app" as the trigger for SD profiles. I suppose if you wanted to go that far you could aways make a "blank app" for each Logic window, and setup a Keyboard Maestro macro to activate the appropriate app using an IF action triggered when the focused window changes. Seems like a lot of work for little return...but then again I spend hours tinkering around with AppleScripts for silly things like setting DND :laughing:

1 Like

Yes, that's exactly how my plugin profile switching works, as detailed above. All you'd have to do is set the trigger as a front window change and if the front window contains "- Tracks" or "- Piano Roll" it would launch different blank trigger apps via a Switch/Case action. You can download the blank app I included above for use with this. Duplicate it and rename one to "Piano Roll" and the other to "Tracks". Associate the corresponding SD profiles with these apps in the SD software.

The only thing to be aware of is that opening the trigger app changes window focus again, which can cause a feedback loop, so I included a "Break Loop" macro to deal with that. It sets the variable SDProfile to "DoNotRun" and then deletes it after an interval long enough for the profile switch macro to complete. In the meantime, it precludes the macro from running more than once. It's the most elegant solution I could come up with. I've set the interval to 0.5s, but you may want to monkey around with this, depending on how snappy your system is.

- Logic - Tracks:Piano Roll SD Switch Macros.kmmacros (90.3 KB)

1 Like

Man I didn't at all realize that it was this exact thread where I read that. When I go into the "Latest" section of the forum and click a link it just drops me down to the new comments since the last time I visited and I don't always look through the previous comments before responding :laughing:

Thanks for the reminder!

1 Like

Hi! I'm new to KM and Stream Deck som I'm sorry if I sounds like a newbie. What do I do with this blank app? I can't open it and i can't load it in either Stream Deck or KM.

Download it and make copies of it for each SD profile you'd like to trigger. In this example, I've duplicated the blank app and renamed it Channel EQ. Whenever I open this app via KM, it loads the associated SD profile.

Ah, I get it! Thank you.

I'm getting closer but the stream deck software doesn't seem to recognize the blank apps. When I launch the app it won't switch the profile. It says it's "Blank App" even after I've renamed it.

Any ideas what I might do wrong?

Edit: Looks like this is a problem with the Stream Deck software and not the blank apps. No applications make the profiles switch. Running MacOS Monterey 12.0.1 and SD 5.2.0.

Edit 2: "Actually, the feature is working as intended.

To be able to edit the canvas, Smart profiles are disabled when the main application window is open."

Edit 3: It now works as intended with duplicated Blank Apps. I'll leave this post up if anyone has the same problem as I.

1 Like

Okay, I'm nearly there but I have one last issue. I can't seem to make a correct OCR result. Can it be because you have a different screen resolution than you?

When I load a plugin this is what I get. When it's not loaded it says "BLANK".

I vaguely remember running into that issue but it's a long time ago now and I'm afraid I can't for the life of me remember what the solution was. Perhaps someone with more OCR knowledge can chime in? Perhaps one of these threads has the answer? One post suggests that it might just mean the OCR failed, so you should probably try the brand new OCR area function that was added in KM 10...?

Thank you, I'll check it out.

I hate to hijack this thread, but since I've seen a fair amount of interest in this the last couple of years, I reached out to Elgato to ask them about implementing it in the future, and they replied today.

You can read more info here:
Elgato's Response to Setting Stream Deck Profiles via Keyboard Maestro or Other Third Party Apps

1 Like

Solved: Keyboard Maestro Engine did not have screen recording permission. When enabling this in System Preferences -> Security and Privacy -> Screen recording, it is now working.


I'm sorry to trouble you with all my questions but I'm so close to making this work. The Logic profile works, the generic profile works and the custom plugin profiles work. The only think that's not working is "Break OCR loop" and "Break profile loop".

I'm pretty sure I've followed all your steps but KM still continues do an OCR scan every time it launches a trigger app and goes back to logic.

Any ideas?

Hmm. Hard to say without seeing your setup, but I would first experiment with the pauses in the Break Loop macros.

Did you change or replace any of the actions? For example, the Break Profile Loop (SUB!) action needs to be asynchronous, so if you added your own Execute a Macro action, without setting it to asynchronous, it might not work.

I'm not really an expert on debugging and I find it can get quite confusing, but if you're accustomed to it, perhaps try running the macros step by step and seeing if the Break Loop macros are kicking in at the right time?

There are a lot of moving parts, so I'm kinda stabbing in the dark here. If only Elgato would just enable external profile switching this would be a lot less complicated!

I've simplified and improved the macros and updated my original post. It now determines whether the window is a plugin by detecting the "Compare" button (rather than using a Window Whitelist). This is quicker and seems to more reliably avoid profile switch loops. I've also included a 'Setup' macro, which makes it easier for you to get going.

Update: Removed the need for the Break Loop submacro by using a Semaphore Lock instead. I have the pause at the end of my Switcher macro set to 0.3s and it works nicely. The macros I've uploaded have it set to 0.5s for safety but feel free to experiment.

1 Like

Can you please make a Video on how to set up the stream deck for the plugins and how to install this/ get this working? I bought a streamdeck and keyboard maestro after seeing your video on the streamdeck+nob workflow. I am new to the stream deck and keyboard maestro so I am lost on how to get this working. Thanks of the workflow enhancement

1 Like

Hi @Jukobe and welcome to the forum! It's a lovely place full of very helpful people.

Congratulations on buying the Stream Deck and KM. It's an incredibly versatile combo. Make no mistake though, we're using it in a way that neither developer foresaw, so you're going to have to be patient and get your hands dirty. The first thing to do is spend a week or so getting to grips with each product's core functionality. Set up some SD profiles with hotkeys and explore all the other button types. Use your imagination and think about what problems they could solve for your own way of working. Go through the forum and download any macros that sound like they might be of interest to you. Open them and have a look through the actions to get an idea of the thought process behind them.

Before I start making videos, what is it you're confused by? I've done my best to lay out the steps above, so if any of it's unclear, I'm happy to explain.

1 Like

Thanks, Ive been researching the last 2 days a bit on stream deck and keyboard maestro. Im experimenting on mouse macros.

Im lost on how you mapped your cursor on each plugins respective control and how to get the profiles to switch when the plug ins open. Again thanks a lot.