Author Topic: Auto-switch 'default' not working as expected...  (Read 6862 times)

FearNaBoinne

  • Guest
Auto-switch 'default' not working as expected...
« on: January 03, 2017, 05:21:39 AM »
I have set up profiles to match certain programs, and one that matches '*', which, according to the documentation, means, this is the default if nothing else matches.

However VoiceAttack (v1.6.1) seems to disagree with the documentation.

Let's say I have several profiles, and two of them have autoswitch matching:
1) Thunderbird - Autoswitch '*Mozilla Thunderbird*'
2) My Profile - Autoswitch '*'

If I manually select any profile, and then move to a new window, it always goes to 'My Profile', even if that 'new window' is actually Mozilla Thunderbird.

If I uncheck the autoswitch in 'My Profile', it works as expected, but obviously the profile always remains on whatever got selected last.
If I check the autoswitch in 'My Profile', it *always* switches to 'My Profile'.

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: Auto-switch 'default' not working as expected...
« Reply #1 on: January 03, 2017, 06:02:13 AM »
I had/have this same problem. VA Wildcard likes to overrule everything. I think it would work better off a select list. If windows title is this, and on the list, switch to that profile, if it isn't anything from this list, then switch to default profile. I've also seen VA completely not notice a switch of windows titles at all. So, you have to switch back and forth between programs, till VA notices.

I actually created my own profile switcher. That worked good for me.

Code: [Select]
Start Loop While : [{EXP:1=1}] Equals '1'
    Begin Text Compare : [{EXP:'{ACTIVEWINDOWTITLE}' LIKE '*Opera' And '{ACTIVEWINDOWTITLE}' LIKE '*Edit Style*'}] Equals '1'
        Change to profile, 'CSS'
    Else If Text Compare : [{ACTIVEWINDOWTITLE}] Ends With 'Torch'
        Change to profile, 'Web'
    Else If Text Compare : [{ACTIVEWINDOWTITLE}] Starts With 'Virtual Pool 4'
        Change to profile, 'Virtual Pool'
    Else If Text Compare : [{ACTIVEWINDOWTITLE}] Contains 'Developer Tools'
        Begin Text Compare : [{EXP:'{STATE_KEYSTATE:TAB}' = '1' OR '{STATE_KEYSTATE:CTRL}' = '1'}] Equals '1'
            Change to profile, 'CSS'
        End Condition
    End Condition
    Pause 1 second
End Loop

You can load that command to start with the profile.

Well, I hope this helps you out, just adjust it to fit to your liking.

FearNaBoinne

  • Guest
Re: Auto-switch 'default' not working as expected...
« Reply #2 on: January 03, 2017, 07:12:36 AM »
And I need to do that in every profile I load?

FearNaBoinne

  • Guest
Re: Auto-switch 'default' not working as expected...
« Reply #3 on: January 03, 2017, 08:06:54 AM »
I've found I need to do it in every profile (as any profile switch causes it to be stopped), but as long as I link the profile containing the switcher function somewhere in the profile queue, I can call it using the execute command by name option...

To prevent the log area from getting inundated with profile switch messages every second, I've adjusted it slightly:

Code: [Select]
Begin Text Compare : [{ACTIVEWINDOWTITLE}] Equals 'VoiceAttack'
    DISABLED - Write '[Red] VoiceAttack in front, not switching!' to log
Else If Text Compare : [{ACTIVEWINDOWTITLE}] Contains 'Thunderbird'
    Begin Text Compare : [{PROFILE}] Does Not Equal 'Thunderbird'
        Change to profile, 'Thunderbird'
    End Condition
Else If Text Compare : [{ACTIVEWINDOWTITLE}] Contains 'Chrome'
    Begin Text Compare : [{PROFILE}] Does Not Equal 'Chrome'
        Change to profile, 'Chrome'
    End Condition
Else
    Begin Text Compare : [{PROFILE}] Does Not Equal 'My Profile'
        Change to profile, 'My Profile'
    End Condition
End Condition
Pause 1 second
(Just using a few example profiles as a test, I'll be expanding it as desired)

But until the built in system gets fixed, this will do nicely, thank you!

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: Auto-switch 'default' not working as expected...
« Reply #4 on: January 03, 2017, 11:55:28 AM »
Sure, glad I could help! :)

Just to make sure though, you are using the Profile Options feature to execute a command each time a profile is loaded right? Then you just add the Auto Switching command to each profile? I wasn't sure if that is what you said, or you were running it manual after each switch. When you switch profiles, it should wipe the log area, and just say it executed the Auto Switching command, so, I don't know why you said the log area was inundated with profile switching messages. This should be a automated process, without you having to trigger anything, after you add the command to the Profile Options.

I added some pictures to just make sure you understand, and for anyone else who might not realize this menu exists. I know I overlooked it for a long time myself.

Once you add the Auto Switching command to each profile you switch to, it will be come automated between those profiles, and automatically switch profiles, when that windows title appears. Just remember if you make a new profile, to add the Auto Switching command to it.








Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: Auto-switch 'default' not working as expected...
« Reply #5 on: January 03, 2017, 10:25:53 PM »
Hmmm...  I think I may see something in here.  I'm going to try to see if making a small adjustment might help out here.
I was thinking I was using the same code I am using for targeting... there might be a part where it's being a little too eager.  Let me see what I can come up with.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: Auto-switch 'default' not working as expected...
« Reply #6 on: January 03, 2017, 10:44:43 PM »
I threw a build out in the, 'unofficial' bin:  http://www.voiceattack.com/unofficial

Try that one out and see if it fixes your issue.  NOTE: You will want to install the beta first before using this one, otherwise you'll be missing the scintilla dll and the inline function editor will blow up ;)  I'll probably have another beta this weekend.

FearNaBoinne

  • Guest
Re: Auto-switch 'default' not working as expected...
« Reply #7 on: January 05, 2017, 02:45:34 AM »
Been too busy for testing, but will do so shortly... At least the 'workaround' seems to be doing exactly what I want it to do, at the 'expense' of a startup command in each loadable profile that does an execute by name of the switcher command!   ;)

FearNaBoinne

  • Guest
Re: Auto-switch 'default' not working as expected...
« Reply #8 on: January 05, 2017, 02:51:02 AM »
Sure, glad I could help! :)

Just to make sure though, you are using the Profile Options feature to execute a command each time a profile is loaded right? Then you just add the Auto Switching command to each profile? I wasn't sure if that is what you said, or you were running it manual after each switch. When you switch profiles, it should wipe the log area, and just say it executed the Auto Switching command, so, I don't know why you said the log area was inundated with profile switching messages. This should be a automated process, without you having to trigger anything, after you add the command to the Profile Options.

I added some pictures to just make sure you understand, and for anyone else who might not realize this menu exists. I know I overlooked it for a long time myself.

Once you add the Auto Switching command to each profile you switch to, it will be come automated between those profiles, and automatically switch profiles, when that windows title appears. Just remember if you make a new profile, to add the Auto Switching command to it.

Yes that is what I did, but as it is a loop, it keeps switching to the same profile after it's switched, so it keeps adding the 'switched to' log entry (doesn't wipe log when you switch to the same profile), which I fixed by checking whether it is already in the correct profile before switching...

What I have done is create a separate switcher profile (so I only need to edit a single function whenever a new autoswitch profile is added), and then linked that profile through the 'include commends from' option. Then in the 'execute on load' option I have a function which simply does a "Execute command 'switcher' (by name)"...

FearNaBoinne

  • Guest
Re: Auto-switch 'default' not working as expected...
« Reply #9 on: January 05, 2017, 07:31:55 AM »
I threw a build out in the, 'unofficial' bin:  http://www.voiceattack.com/unofficial

Try that one out and see if it fixes your issue.  NOTE: You will want to install the beta first before using this one, otherwise you'll be missing the scintilla dll and the inline function editor will blow up ;)  I'll probably have another beta this weekend.
Seems to be working!  :)

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: Auto-switch 'default' not working as expected...
« Reply #10 on: January 05, 2017, 08:59:09 AM »
Ok, cool.  I'll have a full beta out that will contain that fix in the next couple of days.

Thanks for the update ;)

FearNaBoinne

  • Guest
Re: Auto-switch 'default' not working as expected...
« Reply #11 on: January 06, 2017, 09:01:14 AM »
You're welcome!

There are few things that are as irritating as a tester/user not letting you know whether a change fixed a problem or not! (I know from experience!)