Same Hot Key / Different Macro?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
jim elsworth
Newbie
Posts: 1
Joined: Fri Oct 17, 2003 6:45 pm

Same Hot Key / Different Macro?

Post by jim elsworth » Fri Oct 17, 2003 6:51 pm

Greets,

Is it possible to have the same hot key trigger a different macro depending on what application is in the foreground? Thanks for any answer, yea or nea.

rgds
jim

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Oct 17, 2003 7:02 pm

Hi,

Yes. Have one controlling macro which is assigned the hotkey and have this macro check to see what the foreground app is and act accordingly. As it happens this is in the FAQ:

http://www.mjtnet.com/msfaq14.htm
MJT Net Support
[email protected]

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Oct 17, 2003 7:04 pm

:idea: In the macro(s) called by the hot key, you can add a few lines at beginning to check for active window name and execute or quit depending on window name.

(Edited comment: I posted this while the previous response was being submitted by support. I did not their similar response before I wrote this one).
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Guest

Post by Guest » Fri Oct 17, 2003 9:22 pm

Unfortunately one of the applications I'm trying to script is a telnet app and the window name is the name of the telnet host. Since I have no idea of what the hostname is going to be, the window name checking scheme given in the FAQ doesn't help here.

Thanks for the prompt and helpful replies.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Oct 17, 2003 9:28 pm

Hi,

Is there not something in the title that doesn't change so that you could use the wildcard character?
MJT Net Support
[email protected]

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Oct 17, 2003 11:06 pm

Not possible to use GetActiveWindow> with a telnet session?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts