Author Topic: Help with Global Profiles and Auto Profile Switching  (Read 1509 times)

sunnyod

  • Newbie
  • *
  • Posts: 13
Help with Global Profiles and Auto Profile Switching
« on: February 13, 2021, 07:42:31 AM »
Hi,


I've installed voiceattack and setup several profiles. I'm having difficulty working out how to setup a Global profile and also auto detecting software that I run alongside the global profile.

Ideally I want the global profile to be running at all times, but I want other profiles to become active when the active window process matches that which I have allocated in each profile.

For example. If I launch Photoshop I want VA to automatically detect that and switch to the Photoshop VA profile but I still want to be able to control my media using VA. The same for games,  I always want global profile to be active during those too.

I've had a look at the documentation and tried messing with the global settings and per profile settings, but maybe I just don't get the concept behind linking profiles. I've also set Auto Switch Profiles to true under the main settings.

It's also unclear how I need to reference the application in each profile. Do I use the full path to the .exe or is it just the name of the .exe?

I think I'm just not getting some key principle and it's gonna be an easy fix!

Any suggestions?

Thanks

Sunny

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Help with Global Profiles and Auto Profile Switching
« Reply #1 on: February 13, 2021, 02:26:50 PM »
If you set up any global profiles, those are made available in any active profile (though individual commands can be overridden by the active profile, or any profiles explicitly included into the active profile, if those contain commands with identical phrases).


If you want a profile to be made active whenever the "Enable profile switching for the following windows or processes" option for any other profile does not contain anything that matches the currently active window's title or process name, you can configure the "Enable profile switching for the following windows or processes" option for that profile with the "*" character, as mentioned in the documentation.


Process names do not include a path to a file, and should not include the ".exe" file extension

One way to get that information for a given window is to open the "Perform a Window Function" action's dialog, which shows the window title, process name, and other properties, of the active window (though note that the "Enable profile switching for the following windows or processes" feature does not currently accept targeting prefixes like "~").


E.G. you can have "Profile A" set up to target "*" while also being configured as a global profile, and "Profile B" set to target "notepad"

By default, "Profile A" will be the active profile.

If you then switch to Notepad (which has the process name "notepad"), "Profile B" will be loaded, with the commands from "Profile A" also available

Should you then switch to another application, which does not have a profile associated with it, "Profile A" will become the active profile again.

sunnyod

  • Newbie
  • *
  • Posts: 13
Re: Help with Global Profiles and Auto Profile Switching
« Reply #2 on: February 14, 2021, 07:27:55 AM »
Awesome thanks so much for the help, Pfeil, that's worked a treat. Looking forward to building out loads of profiles :)

One more question I came across is is it possible to add commands to switch to different applications using the Global profile? For example, If I'm using notepad and want to switch to Discord, I'd like to be able to say "switch to discord". Is that possible?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Help with Global Profiles and Auto Profile Switching
« Reply #3 on: February 14, 2021, 03:29:22 PM »
You can use the "Perform a Window Function" action to switch focus to a different application.
Note that switching profiles stops all commands, so anything after that action may not execute if the target application has a profile associated with it.

sunnyod

  • Newbie
  • *
  • Posts: 13
Re: Help with Global Profiles and Auto Profile Switching
« Reply #4 on: February 14, 2021, 04:28:52 PM »
Thanks for you help! Really appreciated

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: Help with Global Profiles and Auto Profile Switching
« Reply #5 on: February 17, 2021, 02:56:37 PM »
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.

Code: [Select]
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.

Code: [Select]
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.

sunnyod

  • Newbie
  • *
  • Posts: 13
Re: Help with Global Profiles and Auto Profile Switching
« Reply #6 on: February 18, 2021, 04:01:31 AM »
Ah that's interesting. So many ways we can use VA, what a tool. Thanks I'll see how I can use what you've shared it looks very powerful  8)