Can Stream Deck go to the previously used profile?

I have a system of Photoshop profiles, and one of them is for “masking” commands. I want to go to that masking profile from a variety of other Photoshop profiles, but have a return button on the masking profile that takes me back to the previous profile, regardless of which it was.

Is there a way to have Stream Deck go to the previously used profile when a button is pressed? I don’t need to go more than one profile back. Without this ability, the utility of profiles seems quite limited.

If this can’t be done with the Stream Deck software, what about Better Touch Tool?

Thanks,
Russell

You can use the Switch to Profile action built into StreamDeck to switch to a different profile. You can even define the specific page of a profile to go to directly in each button.

But you can only assign one profile to Photoshop. The application won’t allow otherwise. I’m not sure what you mean by, “a system of Photoshop profiles.”

Do you mean pages? If so, see above.

Thanks for the quick response.

I’m using multiple profiles for Photoshop (not pages or folders) because I need to go to a set of buttons (for example, adjustment layers) from a variety of other button sets with a single button press. And, instead of putting this in duplicated folders, there’s only one set of buttons to edit when I find improvements.

But my problem is returning to the previous profile, whichever one took me to the adjustment layer profile. Really, kind of like the “back” button in Safari. In the end, I may have to give up the multiple-profile idea and just put buttons in lots of duplicated folders. The idea is to move around directly, rather than a lot of drilling in and out with button presses.

Best,
Russell

I don’t understand how you force it to accept more than one profile in the settings app. Or how you expect it to know which profile it should be using for the current job. All StreamDeck knows is you’re using Photoshop. It can’t discern what part of Photoshop you are using. The whole point of profiles is for StreamDeck to switch to the profile for the current up-front application. What am I not understanding?

I just tried to create a second profile for Photoshop, and it said there already was a profile for Photoshop and this profile “will not be executed.”

You can create profiles not tied to be switched to when an app is activated. E.g. You could have a podcast ing profile, a blogging profile, a work profile. Manual switching for such profiles means you can have multiple profiles available in any app, but you may have designed them for a single app.

I don’t think there’s any way to do this with the Stream Deck software (SDS) as it doesn’t have any scripting and I think you need some data storage, and maybe some conditional logic handling depending upon how they implemented it … which they haven’t so that’s a moot point.

Better Touch Tool (BTT) on the other hand does allow for more flexibility. I think I can see a way to do it, but I am not going to say I would recommend doing this as it is a little convoluted.

Profiles => Groups/Folders

In BTT, profiles work on conditions and automatically switching you in and out of them - like when you switch apps. I don’t think that you want that. I think instead you would want to use groups. They are the same sort of idea as folders in SDS, but only sort of, and confusingly, whereas they seem to be referred to as groups in many places, there’s also practically an equal number where they seem to be called “folders”.

Forward

With the groups in place and populated, you can add additional Stream Deck button entries to trigger your navigation, switching to another group by name (Open Stream Deck Group With Name). However, you also need to build a history, so you can set a variable in BTT to be the name of your current group - i.e. you are saving the name of the group you want to return to.

e.g.

Backward

Variables are accessible to scripting like AppleScript, but not so much to the internal actions of BTT by the looks of it, so your return button would need to trigger a script that in turn access the BTT variable and makes a decision based on that.

I don’t see any AppleScript way to open a group by name, but we already know there is a way to open a group by name using an action. You can create Named Triggers which can be triggered from an AppleScript script, so if you created one of these ofor each group you need to return to, you can have your ‘return to previous group’ trigger the appropriate named trigger.

After doing this, we need to update the historic variable so we nown where to return to from there. Except, we haven’t stored that. So prior to triggering the script, we should set another variable (say currentFolder) to the name of the current group, then the script can copy the content from that into the new one - or better yet it could exchange the values between the variables.


You might be getting the idea of why I wouldn’t necessarily recommend this approach. Typically a developer might code this sort of thing into the background of the system in a simpler way to avoid you rolling your own multi-level convoluted solution. But I don’t think that’s around right now, and this was the nearest I could get while idling over a cup of tea and thinking about the issue.

Mull it over, and good luck if you do want to try that approach. With any luck, someone else will have an idea that is less concoluted than this one.

Never mind, this comment is no longer relevant.

Wait, I think I see where you’re coming from now. Okay bear with me…

If you only need to go back one profile, what you can do is set up a Keyboard Maestro macro that uses the Stream Deck icon in your tool bar to select the profile you want to go to. If you start from a specific profile in the beginning, you could then keep putting the profile you’re in, into a variable in Keyboard Maestro, and then when you switch to a specific profile, you keep updated variables for where you now are and where you were before. And then use the KM select menu action to switch automatically, and then update the variables appropriately…

Does that make sense?

Does the menu interaction step work direct with the Steam Deck app? It is primarily a menu bar app.

I had thought you had to use click on image to activate the menu (unless you used Bartender to assign a hotkey), and then does it start with the item in the menu rather than the usual menu bar item like “File”?.

Thank you, sylumer and leicaman, for the ideas.

Bartender can open the SD menu, and Keyboard Maestro with this AppleScript can select items from it. This example is to load the SD profile for my Lightroom “home” set of buttons:

Have Bartender open the menu, then…

So, in this example I have LR-Home stored as a variable and could make a button that runs a Keyboard Maestro macro that would take me back. I’ll give it a try.

Thanks again,
Russell

I use it with any Menu Bar item that has a pull-down menu. It’s really quite easy to set up. You don’t need Applescripts to do it. You can just drag down in the macro in Keyboard Maestro and select the application, and then the menu items you want to select.

Actually, any application. For example, Photoshop with menu items buried down several levels. It’s darn near instantaneous.

You lost me on the “dragging down” in a macro, but the easy set up certainly has my attention, unfortunately I habven’t yet been able to figure out what the approach is :person_shrugging:t2:

I use the “Select of Show a Menu Item” in Keyboard Maestro macros to trigger menu items, for an app, but this requires you to select a top level menu item. so either you would need to specify something for this or use a different action.

Looking at the wiki page for this action it discusses the main mapp menu items, and the Apple menu, but nothing about accessing menu bar app menus for apps like Stream Deck.

I found a Keyboard Maestro forum discussion of the topic which seems to asupport this, but it is a few years old and Keyboard Maestro has obviously had some updates since then.

Altogether, this strongly suggests I’m looking at the wrong action.

I had a look for other actions for menus, but the only one I found was Show Status Menu, which is for interacting with Keyboard Maestro.

It certainly feels like I must be missing something obvious at this stage :slightly_frowning_face:

Could you post a screenshot or highlight what I’ve overlooked based on the above? I would really like to have a way to interact with such menu bar app menus directly from Keyboard Maestro. I’ve had a lacxk of reliability with other approaches in the past until other apps stepped in to allow triggering of the menu bar item. If I could consolidate and simplify to Keyboard Maestro for this, then that would be quite handy.

leicaman is right-- I don’t need the AppleScript. And it appears you don’t need Keyboard Maestro’s “Select or Show a Menu Item” action. Instead, when Bartender reveals the Stream Deck dropdown menu, just have Keyboard Maestro “insert text by typing” the menu item. (insert by pasting didn’t work) Maybe I have some kind of Accessibility feature enabled, but “typing” when a menu is pulled down selects the item.

I think I’ve worked out a way to have Stream Deck return to the previous profile:

Instead of using Stream deck’s “switch profile” command, have Stream Deck use KMLink to do it, and have the targeted Keyboard Maestro macro store the current profile’s name (the one I’m switching away from) in the variable “PreviousProfile” before it does the switch via the AppleScript or the “insert text by typing” method I described in my prior post.

I also put a Keyboard Maestro macro in the “global” folder (so it works with both Lightroom and Photoshop), which calls the Stream Deck menu via Bartender, and uses the “PreviousProfile” variable to select the item. In each of my Photoshop and Lightroom profiles, I have a “return to previous profile” button that calls this macro via KMLink. I had to do some IF-THEN nesting to differentiate between Lightroom and Photoshop, but even I could figure that out. So far, it seems to work! (I’m a visual artist, not a programmer-type, so this is all flying by the seat of my pants.)

1 Like

Glad you figured this out so I didn’t have to go into a long discussion on apps that don’t show up in the “Show Menu Item.” You could have it click on the image of the Stream Deck icon and then click the profile, but that’s problematic if the zoom on your screen ever changes.

I think your solution works better anyway. I certainly am going to consider using it as well. I can see the value of doing things that way.

One question about that. What do you mean calling the Stream Deck menu via Bartender? How do you do that?

In Bartender preferences, under Hot Keys, in the bottom section you “Add menu bar item hot key.” That lets you simulate a mouse click on any menu bar icon.

I set Stream Deck to be Ctrl Sh Cmd A, and have Keyboard Maestro enter that when I want the Stream Deck menu to drop down.

I attempted to do this when I first got my Stream Deck a few months ago with variables in BTT as per @sylumer’s initial thought out solution and gave up. I’m happy that maintaining PreviousProfile in KM has worked for you! There’s always more than one way to skin a cat, well done on getting it working @sylumer / @leicaman / @rbanks88! We are so lucky to have many minds working on these issues.

As far as my current strategy goes on Stream Deck profiles, I’m coloring inside the lines with the Elgato Stream Deck app, creating my own hierarchical series of Profiles and manually switching between them. I use KMlink to trigger any additional actions when changing profiles (setting focus modes, etc). I’ll definitely keep this thread in mind if I find myself in a similar situation!

That’s a great trick. I’ve used it in Keyboard Maestro for a couple of things already! Thanks.

possible to share your macro for this? Very interested in simplifying my stream deck setup for streaming and music production and having multiple profiles that i can paste into different pages that go back up a page instead of always to the home screen would be amazing.

Happy to help, if I can. But as I said earlier, I’m a visual artist, not a programmer-type, so this is all flying by the seat of my pants!

In my March 12 post, I wrote that I had to do some IF-THEN nesting to differentiate between Lightroom and Photoshop, but I avoided that by using one variable for Photoshop (PSPreviousProfile) and another variable for Lightroom (LRPreviousProfile). If you’re working in one application, you won’t have to worry about differentiating.

The foundation of my approach is using a Bartender hotkey to pull down Stream Deck’s menu. I chose something awkward to type manually, so I’d be unlikely to can use it for anything else: Sh Ctrl Cmd C.

After opening the Stream Deck menu via Bartender, I use an Applescript to choose the desired SD profile. (My first approach was using an “insert text by typing,” Keyboard Maestro action to select the profile in the opened Bartender menu, but the Applescript is more reliable.)

I’m posting on Google Drive two macros: (they assume you’re switching around, and in and out of, just one app. If you’re using separate apps concurrently for your streaming and music production, see "TWO APPS, below)

Macro 1. “SD Profile: [your target profile’s name]” (put this macro in your app’s group)

In the red actions, you have to change “SDProfileName” to the name of your profile you want to load.

The green actions are Lightroom commands you’ll want to change to set up whatever state you want your application to be in after the SD profile changes. (Remember, there are two steps: changing the SD profile to get the buttons you want, and changing your application’s interface to work with those buttons.)

Macro 2: “SD Profile: Return to previous profile” (put this macro in your global group)

This macro gets you back to your previous SD profile when you switch to another app and return to your previous app.

TWO APPS

If you want to jump back-and-forth between two related apps, each with their own set of SD profiles (like I do with Lightroom and Photoshop), it’s a little more complicated. You have to have a separate “pair” macros for each of the two apps. In those, the macro names and variable names are differentiated by starting one with LR and the other with PS. I’ll post those also, and among all these, you should be able to put it together.

Google Drive link: SD Profile-Switching Macros.zip - Google Drive

If you have any questions, let me know, and I’ll try to give a coherent answer!