Something else you could do as well, is just put all the commands into one profile.
Here's an Example of one button doing different things depending on what program you have as your active window. Doing it this way, you don't have to wait for the profile to switch.
This works every time, without issue, as long as you have the active window title, or process name, or ID correct.
So I can have the same button do something different for every program I'm in, as long as I add it to the command. You can even add commands that only trigger after holding the key for .3ms. and have a whole list of different commands that activate for all those programs as well. So now you have 1 button doing 2 different possible things.
Begin Text Compare : [{ACTIVEWINDOWTITLE}] Equals 'Virtual Pool 4'
Press and release G key
End Condition - Exit when condition met
Begin Condition : ([Video Mode] Equals 0 AND [{ACTIVEWINDOWTITLE}] Contains 'PotPlayer')
Press / ? key and hold for 0.1 seconds and release
End Condition - Exit when condition met
Begin Condition : [{ACTIVEWINDOWPROCESSNAME}] Equals 'Notepad' OR [{ACTIVEWINDOWPROCESSNAME}] Equals 'Notepad++'
Press Left Alt+F4 keys and hold for 0.1 seconds and release
End Condition - Exit when condition met
Begin Text Compare : [{WINDOWPROCESSUNDERMOUSE}] Contains 'Everything'
Press Left Alt+F4 keys and hold for 0.1 seconds and release
End Condition - Exit when condition met
How to create a delayed command.
Set small int (condition) [Seconds] value to 0
Start Loop While : Keyboard Key 'F12' Is Pressed
Set small int (condition) [Seconds] value as incremented by 1
Write [Blue] '{SMALL:Seconds}' to log
Pause 0.1 seconds
Begin Small Integer Compare : [Seconds] Is Greater Than 3
(Put commands here.)
End Condition - Exit when condition met
End Loop
I've used this routine thousands of times, without issue.
In this case. F12 key will trigger this command, and if you hold it for .3ms it will look at the commands in here to run, if there is anything that matches.
Place that Routine, at the top of your command so when you hit F12, it's the first command to run, if the button isn't held for .3ms, it will continue on to the commands below it, if it is .3ms or more, it will try to run the commands inside of it, and if nothing matches a active window, it will do nothing. So, make sure your pointing to the proper window you want.