Author Topic: Need help with target?  (Read 6360 times)

kingsmith13

  • Guest
Need help with target?
« on: April 11, 2018, 10:04:47 PM »
Hello everyone

. I am using Voiceattack to help me on some of the Adobe Premiere keyboard shortcut and Firefox. I would like to know how do I keep the command for the target application separately. Example: I made a lot of command for Adobe Premiere but when I switched the profile to Firefox, my target still not able to change. I have to always click on the right down arrow to manually switch it. Is there a way to switch the target differently if every time if I decided to switch profile? ::)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Need help with target?
« Reply #1 on: April 12, 2018, 04:57:26 AM »
There are a number of ways to set a command target:
  • The "Send commands to :" dropdown on VoiceAttack's main window
  • The "Send commands to" checkbox and dropdown in the profile options menu
  • The "Send this command to" checkbox and dropdown in the "Edit a Command" window"
  • The "Perform a Window Function" action with the "Set command to target this window" checkbox checked

If you're using one profile per application, you could use the profile-based option:

Click , click , in the "Profile General" tab check the "Send commands to this target :" box, click the radio button next to the dropdown, select or type the window or process name into the box, click "OK", "click "OK" to save the profile.

With this option active, anything you set in the "Target" dropdown on the main window will be ignored in favor of the profile setting.

iceblast

  • Sr. Member
  • ****
  • Posts: 374
Re: Need help with target?
« Reply #2 on: April 12, 2018, 06:32:37 AM »
Also, make sure that the main VA window says, Target Active Window, and not Adobe's.

I find it easier to not make a different profile for another program. You can just use {ACTIVEWINDOWTITLE} or {ACTIVEWINDOWPROCESSNAME} or {WINDOWTITLEUNDERMOUSE} or {WINDOWPROCESSUNDERMOUSE} and even by {ACTIVEWINDOWPROCESSID}

So, If you want to use the same key on a different program. It will check what the window title is, or Process Name, or ProcessID and trigger the action depending on what program you are in. If it's the wrong window, it won't do anything at all, if you don't have that window selected as a option.

The great thing is, you can stack these commands if you want, and make it so you don't have to switch profiles that often.

Here's an example. This command checks for many things, and does other things, all with the press of one key.

1. It lets me switch to overhead display, if I'm play Virtual Pool 4.

2. If I hold the key for more than 0.3 seconds, it will trigger a special action.

3. If I'm in Pot Player, it will bring up my playlist.

4. When you have your mouse over a speed dial in Opera, it will open the webpage in a new window.

5. If I hold the Left Mouse Button down, and trigger this command, it will open a txt file with the last 10 things I added to the clipboard.

6. This one checks to see if I'm in one of two programs. If I am it will type {.

7. If the mouse it at the top of the screen, it will change the system volume to 20%.

8. The Last command, if I'm in none of the programs above. If I tap the key, it will Right click on a webpage link and use the mouse window to open the link in a new web browser window.

I did all the this without the need to switch profiles. Maybe this will give you a idea that you can build on.

Code: [Select]
Write '[Blue] {WINDOWPROCESSUNDERMOUSE}' to log
Write '[Blue] {MOUSESCREENY}' to log
Set integer [Max] value to 30
Set integer [ICQ Show] value to 1050
Set small int (condition) [Seconds] value to 0
Begin Text Compare : [{ACTIVEWINDOWTITLE}] Equals 'Virtual Pool 4'
    Start Loop While :  Keyboard Key 'F14' Is Pressed
        OverHead
        Press down X key
    End Loop
    Release X key
End Condition - Exit when condition met
Start Loop While :  Keyboard Key 'F14' 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
        Play sound, '{VA_SOUNDS}\stop.wav'
        Save current mouse location
        Click right mouse button
        Pause 0.3 seconds
        Press and release Down key
        Press and release Down key
        Press and release Enter key
        Pause 0.2 seconds
        Press down Left Win key
        Press Up key and hold for 0.2 seconds and release
        Press Up key and hold for 0.2 seconds and release
        Release Left Win key
        Pause 2 seconds
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Pause 0.5 seconds
        Move mouse cursor to screen coordinates by text/token X:1097, Y:328
        Click left mouse button
        Pause 0.2 seconds
        Move mouse cursor to screen coordinates by text/token X:143, Y:925
        Click left mouse button
        Move mouse cursor to screen coordinates by text/token X:142, Y:864
        Click left mouse button
        Pause 0.2 seconds
        Recall saved mouse location
        Pause 3 seconds
    End Condition - Exit when condition met
End Loop
Begin Text Compare : [{ACTIVEWINDOWPROCESSNAME}] Contains 'PotPlayerMini64'
    Press F6 key and hold for 0.1 seconds and release
End Condition - Exit when condition met
Begin Text Compare : [{WINDOWTITLEUNDERMOUSE}] Equals 'Speed Dial - Opera'
    Press down Left Shift key
    Click left mouse button
    Release Left Shift key
    Pause 0.3 seconds
    Press down Left Win key
    Press Up key and hold for 0.3 seconds and release
    Press Up key and hold for 0.3 seconds and release
    Release Left Win key
End Condition - Exit when condition met
Begin Text Compare : [{STATE_LEFTMOUSEBUTTON}] Equals '1'
    Pause 0.2 seconds
    Run application '%windir%\system32\notepad.exe' -with parameters 'c:\Program Files (x86)\VoiceAttack Beta\Apps\Last 10 Clipboard History\Last 10.txt'
    Display window 'Last 10.txt - Notepad' as [Show]
End Condition - Exit when condition met
Begin Condition : [{WINDOWTITLEUNDERMOUSE}] Contains 'Edit Style' OR [{WINDOWTITLEUNDERMOUSE}] Contains 'Developer Tools'
    Write (overwrite), '{CLIP}' to file 'C:\Program Files (x86)\VoiceAttack\Apps\Clipboard Temp.txt'
    Quick Input, ' {'
    Set Text [Temp] to [C:\Program Files (x86)\VoiceAttack Beta\Apps\Clipboard Temp.txt]
    Set Windows clipboard to '{TXT:Temp}'
Else If Text Compare : [{EXP: {MOUSESCREENY} < {INT:Max} }] Equals '1'
    Execute command, '[Balabolka Sound Control;Sound On;Set Balabolka to] [1..100] 2' (and wait until it completes)
Else
    Click right mouse button
    Pause 0.3 seconds
    Press and release Down key
    Press and release Down key
    Press and release Enter key
    Pause 0.2 seconds
    Press down Left Win key
    Press Up key and hold for 0.2 seconds and release
    Press Up key and hold for 0.2 seconds and release
    Release Left Win key
End Condition



kingsmith13

  • Guest
Re: Need help with target?
« Reply #3 on: April 12, 2018, 11:19:58 AM »
There are a number of ways to set a command target:
  • The "Send commands to :" dropdown on VoiceAttack's main window
  • The "Send commands to" checkbox and dropdown in the profile options menu
  • The "Send this command to" checkbox and dropdown in the "Edit a Command" window"
  • The "Perform a Window Function" action with the "Set command to target this window" checkbox checked

If you're using one profile per application, you could use the profile-based option:

Click , click , in the "Profile General" tab check the "Send commands to this target :" box, click the radio button next to the dropdown, select or type the window or process name into the box, click "OK", "click "OK" to save the profile.

With this option active, anything you set in the "Target" dropdown on the main window will be ignored in favor of the profile setting.

Thank you very much I will try this

kingsmith13

  • Guest
Re: Need help with target?
« Reply #4 on: April 12, 2018, 11:21:33 AM »
Also, make sure that the main VA window says, Target Active Window, and not Adobe's.

I find it easier to not make a different profile for another program. You can just use {ACTIVEWINDOWTITLE} or {ACTIVEWINDOWPROCESSNAME} or {WINDOWTITLEUNDERMOUSE} or {WINDOWPROCESSUNDERMOUSE} and even by {ACTIVEWINDOWPROCESSID}

So, If you want to use the same key on a different program. It will check what the window title is, or Process Name, or ProcessID and trigger the action depending on what program you are in. If it's the wrong window, it won't do anything at all, if you don't have that window selected as a option.

The great thing is, you can stack these commands if you want, and make it so you don't have to switch profiles that often.

Here's an example. This command checks for many things, and does other things, all with the press of one key.

1. It lets me switch to overhead display, if I'm play Virtual Pool 4.

2. If I hold the key for more than 0.3 seconds, it will trigger a special action.

3. If I'm in Pot Player, it will bring up my playlist.

4. When you have your mouse over a speed dial in Opera, it will open the webpage in a new window.

5. If I hold the Left Mouse Button down, and trigger this command, it will open a txt file with the last 10 things I added to the clipboard.

6. This one checks to see if I'm in one of two programs. If I am it will type {.

7. If the mouse it at the top of the screen, it will change the system volume to 20%.

8. The Last command, if I'm in none of the programs above. If I tap the key, it will Right click on a webpage link and use the mouse window to open the link in a new web browser window.

I did all the this without the need to switch profiles. Maybe this will give you a idea that you can build on.

Code: [Select]
Write '[Blue] {WINDOWPROCESSUNDERMOUSE}' to log
Write '[Blue] {MOUSESCREENY}' to log
Set integer [Max] value to 30
Set integer [ICQ Show] value to 1050
Set small int (condition) [Seconds] value to 0
Begin Text Compare : [{ACTIVEWINDOWTITLE}] Equals 'Virtual Pool 4'
    Start Loop While :  Keyboard Key 'F14' Is Pressed
        OverHead
        Press down X key
    End Loop
    Release X key
End Condition - Exit when condition met
Start Loop While :  Keyboard Key 'F14' 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
        Play sound, '{VA_SOUNDS}\stop.wav'
        Save current mouse location
        Click right mouse button
        Pause 0.3 seconds
        Press and release Down key
        Press and release Down key
        Press and release Enter key
        Pause 0.2 seconds
        Press down Left Win key
        Press Up key and hold for 0.2 seconds and release
        Press Up key and hold for 0.2 seconds and release
        Release Left Win key
        Pause 2 seconds
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Press and release Down key
        Pause 0.5 seconds
        Move mouse cursor to screen coordinates by text/token X:1097, Y:328
        Click left mouse button
        Pause 0.2 seconds
        Move mouse cursor to screen coordinates by text/token X:143, Y:925
        Click left mouse button
        Move mouse cursor to screen coordinates by text/token X:142, Y:864
        Click left mouse button
        Pause 0.2 seconds
        Recall saved mouse location
        Pause 3 seconds
    End Condition - Exit when condition met
End Loop
Begin Text Compare : [{ACTIVEWINDOWPROCESSNAME}] Contains 'PotPlayerMini64'
    Press F6 key and hold for 0.1 seconds and release
End Condition - Exit when condition met
Begin Text Compare : [{WINDOWTITLEUNDERMOUSE}] Equals 'Speed Dial - Opera'
    Press down Left Shift key
    Click left mouse button
    Release Left Shift key
    Pause 0.3 seconds
    Press down Left Win key
    Press Up key and hold for 0.3 seconds and release
    Press Up key and hold for 0.3 seconds and release
    Release Left Win key
End Condition - Exit when condition met
Begin Text Compare : [{STATE_LEFTMOUSEBUTTON}] Equals '1'
    Pause 0.2 seconds
    Run application '%windir%\system32\notepad.exe' -with parameters 'c:\Program Files (x86)\VoiceAttack Beta\Apps\Last 10 Clipboard History\Last 10.txt'
    Display window 'Last 10.txt - Notepad' as [Show]
End Condition - Exit when condition met
Begin Condition : [{WINDOWTITLEUNDERMOUSE}] Contains 'Edit Style' OR [{WINDOWTITLEUNDERMOUSE}] Contains 'Developer Tools'
    Write (overwrite), '{CLIP}' to file 'C:\Program Files (x86)\VoiceAttack\Apps\Clipboard Temp.txt'
    Quick Input, ' {'
    Set Text [Temp] to [C:\Program Files (x86)\VoiceAttack Beta\Apps\Clipboard Temp.txt]
    Set Windows clipboard to '{TXT:Temp}'
Else If Text Compare : [{EXP: {MOUSESCREENY} < {INT:Max} }] Equals '1'
    Execute command, '[Balabolka Sound Control;Sound On;Set Balabolka to] [1..100] 2' (and wait until it completes)
Else
    Click right mouse button
    Pause 0.3 seconds
    Press and release Down key
    Press and release Down key
    Press and release Enter key
    Pause 0.2 seconds
    Press down Left Win key
    Press Up key and hold for 0.2 seconds and release
    Press Up key and hold for 0.2 seconds and release
    Release Left Win key
End Condition

This one looks a little confusing but I will give it a try. Thank you

iceblast

  • Sr. Member
  • ****
  • Posts: 374
Re: Need help with target?
« Reply #5 on: April 12, 2018, 11:59:17 AM »
Yeah, I guess it was a bit confusing. Here, I made a profile, I just used a couple of things from above. Should give you the idea of how to use it.

Try triggering the command while the mouse it over a link on a webpage. It should open the link in a new browser window.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Need help with target?
« Reply #6 on: April 12, 2018, 12:06:49 PM »
Something to add (if it hasn't been mentioned) is that your profiles can be set up to auto-switch if you change applications.  Take a look at 'Enable profile switching for the following windows' and  ‘Enable Auto Profile Switching’ in the VoiceAttack help document.