Change Stream Deck Profile From Macro

I'm very interested in this. It sounds as though it's quite different to the method I was already aware of. Please do elaborate if you don't mind. It goes without saying that I'd love to try your method if you would care to share it. :pray:t3:

Not to throw water on the proposal, as a matter of fact, I would love to be wrong, but from what I remember, the ability to bundle profiles with your app has always been there. I don't think you can manage those profiles from the StreamDeck UI.

I think this 'node' SDK is just a wrapper on their existing SDK.

That was my presumption too, and I'm hoping it was premature.

It's far from perfect but it works once you've set everything.

Here's how it works. Let's say you want to switch between three profiles that you've already created. You export each one inside the directory of the plugin "com.example.pluginame.sdPlugin"

then you add them at the root level of your plugin's manifest.json:

  "Profiles": [
    {
      "Name": "Profile1",
      "DeviceType": 7
    },
    {
      "Name": "Profile2",
      "DeviceType": 7
    },
    {
      "Name": "Profile3",
      "DeviceType": 7
    }
  ]

You build the plugin and then load it from the Stream Deck app.

In my case the Websocket server starts and is ready to receive messages from my CLI app when the plugin is loaded.

Once the WS server receives any message that triggers the profile switching Stream Deck will prompt you to install the bundled profiles.

Issue 1: You need to delete/remove the original profiles that have the same names otherwise the plugin will create duplicates. e.g. Profile 1 will become Profile 1 copy once it's installed.

Issue 2: If there's any mismatch between the profile names or any of the profiles doesn't exist it gets very buggy and you need to delete the profiles that cause the issues and restart the Stream Deck app and then add again the plugin.

Once the bundled profiles have been installed they act like regular profiles and you can edit them normally as long as you aren't rebuilding the plugin or you remove the plugin both of which will trigger issue 1 again. In that case you need to export the edited profiles and repeat the process once again.

Annoying for sure but workable as a compromise. The next SDK version will add the ability to switch to a specific page of a profile so we won't need as many profiles.

I'll try to share the code in a few days.

1 Like

Here's the code.

Let me know if something doesn't work or if the instructions aren't clear enough. Suggestions for improvements are welcome.

Bumping this old thread, I was looking for a way to do this and came across a pretty simple solution using the idea here: How to Select an Item in an App Menu Bar?

Just change the app in the script to "stream deck" and the typed text to the profile you want to select - you can now trigger profile changes via the stream deck menu dropdown.

All elgato really needs to do is make these profiles assignable to a hotkey via the menubar app, would solve a lot of problems!

1 Like

Thanks so much @method1 for your hint.
I was also looking for a solution to change profiles depending on a focused window of an application.
I tried it today with two windows and it worked surprisingly reliably. Here is the image of my macro (the application is internal so I had to blur some names):

With this apple script I load the profile with name "Media" from Stream Deck instance name "XL", very fast.

set deviceName to "XL"
set profileName to "Media"

launch application "System Events"
delay 0.1
ignoring application responses
	tell application "System Events" to tell process "Stream Deck"
		click menu bar item 1 of menu bar 2
	end tell
end ignoring
do shell script "killall System\\ Events"
delay 0.1
tell application "System Events" to tell process "Stream Deck"
	tell menu bar item 1 of menu bar 2
		tell menu item deviceName of menu 1
			click
			click menu item profileName of menu 1
		end tell
	end tell
end tell


3 Likes

Months of trying to find a solution to this… So far this works like a charm! Will now hook it up to things I want to do :clap::clap:

How did you get it to work? I get an error when I run the script...

In order to help, the people who can help you probably need to know what your error is. They might also need to know what version of KM and macOS you have.

Actually, I ended up not even needing KM, and just put the script in a Shortcut.

Here's how I do it:

SD Profile Switcher - AS (Sub-).kmmacros (38 KB)

Macro screenshot

SD Profile Switcher - AS - Caller.kmactions (688 Bytes)

Still won't work, I get no error message this time but nothing happens. Must be an issue on my end, will try on another machine soon. This one is running MacOS 14.5 (23F79) and KM 11.0.4

Just to make sure...

Is the Stream Deck icon present in your menu bar? Have you entered the correct device name and profile name into the caller? Are the macros both enabled in the Editor, as well as the group they're contained in?

Yes I've made sure that everything is correct. The macro group is enabled, other macros of the group work just fine. I've tried changing the name of the Stream Deck, of the profiles, tried different profiles, restarted the computer, updated the Stream Deck software, checked all the permissions I could think of, but to no avail.

Interesting. Try using this macro to target one of your profiles in the Stream Deck menubar item's menu. Hover your mouse over the profile name and trigger the macro. We want to ensure that the UI element tree tallies with the one in the profile-switching AppleScript. Here's the result when I use the macro:

As you can see, all is well. If anything looks off with your result, that will be the point of failure.

This is the result, so I'm assuming its something to do with my mac?
Screenshot 2025-07-08 at 10.11.40

Ah, I think that because you only have one Stream Deck device, there's no need for a device name. In which case, try this:

SD Profile Switcher - AS (Sub-) (Single Device).kmmacros (38 KB)

Macro screenshot

SD Profile Switcher - AS - Example Caller (Single Device).kmmacros (43 KB)

Macro screenshot

Still no luck, I think my OS Version must be causing the issue. In the midst of a bigger project so too afraid to upgrade right now. Will try later and report. Thank you for your help!

Edit: I also tried with several Stream Decks connected and thought that might be the issue. So I disconnected them all and also removed all the Devices in the Stream Deck software. To rule out any issues in that aspect.