Author Topic: Thanks and Same Command But Different Program?  (Read 1210 times)

MrPlops

  • Guest
Thanks and Same Command But Different Program?
« on: July 26, 2019, 12:19:41 PM »
Hello!  First, thanks so much for this great program!  I found it on steam while I was looking for something to add an EQ to my mic. 

I'm using VA to control a few apps.  They are creating programs like Photoshop, Illustrator, and similar programs.  I'm having trouble with one tool, in particular, the move tool.  I would be really happy if VA could detect what program I have active and apply the move tool.  So, if I am in Photoshop and I say move tool the Photoshop macro will run.  Or, if I am in Illustrator the Illustrator move tool activates.  It gets complicated because my setup has 4 different apps that each have a move tool. 

Currently, I have my move tools triggered like this:  "Photoshop Move tool" or "Illustrator Move tool"  So I just want to say move tool and the macro changes based on what program is active.  Hope that makes sense.

The great thing about this tool in programs like photoshop is 1) it saves time.  2) it allows me to keep my eyes focused on my work.  It works beautifully.  I've created over 160 macros so far for all the common tools and tasks I use on a regular basis.  VA is a godsend.  Again, thanks so much for this fantastic utility!

Oh and just wanted to mention that I created a video to show my class how it's been helping me and its drawing interest.  Its a class of 2k peeps so hopefully some will give it a try and bump up sales.  :)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Thanks and Same Command But Different Program?
« Reply #1 on: July 26, 2019, 12:28:48 PM »
You could use the "{ACTIVEWINDOWTITLE}" token in a condition to check which application has focus, and perform the relevant action.

E.G.
Code: [Select]
Begin Text Compare : [{ACTIVEWINDOWTITLE}] Contains 'Photoshop'
    Press V key and hold for 0,01 seconds and release
Else If Text Compare : [{ACTIVEWINDOWTITLE}] Contains 'Illustrator'
    Press A key and hold for 0,01 seconds and release
End Condition

You could also use "{ACTIVEWINDOWPROCESSNAME}" instead, if you prefer.


Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf, which contains a list of available tokens.

MrPlops

  • Guest
Re: Thanks and Same Command But Different Program?
« Reply #2 on: July 26, 2019, 12:33:23 PM »
Wow thanks for that quick reply.  I really need the help and appreciate it very much.  GG ++ :D

MrPlops

  • Guest
Re: Thanks and Same Command But Different Program?
« Reply #3 on: July 26, 2019, 01:08:07 PM »
@Pfeil It is working!  Thank you many many times.

MrPlops

  • Guest
Re: Thanks and Same Command But Different Program?
« Reply #4 on: July 26, 2019, 04:11:25 PM »
I forgot to mention that I had to use a diffrent token {ACTIVEWINDOWPATH} instead of {ACTIVEWINDOWTITLE} b/c when you have a document open in adobe the active window title changes to the name of the document selected. 

Just wanted to put this out there for anyone that runs into that issue.

iceblast

  • Sr. Member
  • ****
  • Posts: 374
Re: Thanks and Same Command But Different Program?
« Reply #5 on: July 27, 2019, 12:36:06 AM »
{WINDOWTITLEUNDERMOUSE}

Is another good token to use. It allows you to directly target a program window, to get it's windows title, if you happen to have multiple windows on screen at once, without having to make it the Active window. Just lay the mouse cursor above the target App, and it will get the Apps windows title.

Just thought I would throw that out there encase you might find it handy.

VA is a awesome program, I've been using it everyday for like 5 years. Couldn't live without it now. :)


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Thanks and Same Command But Different Program?
« Reply #6 on: July 27, 2019, 12:55:34 AM »
I had to use a diffrent token {ACTIVEWINDOWPATH} instead of {ACTIVEWINDOWTITLE} b/c when you have a document open in adobe the active window title changes to the name of the document selected.

I wasn't sure whether it'd still have the application name in the title (like browsers do, E.G. "Document - Adobe Photoshop"), which is why I also mentioned "{ACTIVEWINDOWPROCESSNAME}", which has less overhead than "{ACTIVEWINDOWPATH}" (the latter requires an additional step on top of the former, internally).