Author Topic: Variables for Active Window  (Read 1519 times)

SteveXM

  • Newbie
  • *
  • Posts: 17
Variables for Active Window
« on: December 08, 2018, 05:31:23 AM »
Hello,

I am writing a VA profile for a text based game that exists on 3 different platforms {Twitch,Discord,Other}.

I want to have one profile that can send commands to 3 different active windows.
I tried using a command "Switch to XXX" and saving the window name as a variable "window".
Then for all of my 10+ commands i have them get sent to a specific active window, that is my [window].
This way i could easily have all 10+ commands work on all windows.

Is there a way to pass the variable into this option (see picture). I tried several things [TXT:window] [window]. nothing worked.

Thanks for the help

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Variables for Active Window
« Reply #1 on: December 08, 2018, 06:01:29 AM »
If you want to use that text variable in a field that accepts tokens, the syntax would be
Code: [Select]
{TXT:window}
In this case, however, you'll need to use the "Perform a Window Function" action(which takes text variables directly as well as tokens) to switch command targets.

E.G.
Code: [Select]
Display window 'window' as [Normal]

For more information, check the "Advanced Targeting" section of VoiceAttackHelp.pdf, pages 184 to 187.

SteveXM

  • Newbie
  • *
  • Posts: 17
Re: Variables for Active Window
« Reply #2 on: December 08, 2018, 06:04:13 AM »
Ok thanks for the help

SteveXM

  • Newbie
  • *
  • Posts: 17
Re: Variables for Active Window
« Reply #3 on: December 08, 2018, 07:54:04 PM »
I need to be able to send the commands to the text game, while I'm playing another game. Hopefully this will still work.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Variables for Active Window
« Reply #4 on: December 09, 2018, 03:38:04 AM »
Sending input to another window will require that window to have focus, so in most cases that will mean the game you're switching away from will not receive keyboard/mouse input until you switch back to it(this is not a VoiceAttack restriction, it's how Windows works).

To be able to switch back and forth quickly, I'd recommend using the clipboard and pasting whatever text you need instead of typing it out, as the former will take much less time.