Determine Window on Top - last active window

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Determine Window on Top - last active window

Post by kpassaur » Fri Sep 23, 2005 10:13 pm

I am trying to determine the Window on Top or should I say the last active window before an Icon residing on the Quick Launch bar activates a Macro Scheduler script.

If I know the Window name it is easy, but I am trying to create a universal script that when an Icon is pressed on the task bar, the last window will be switched to, using the GetCaretPos and mouse move command, the item the cursor is over will be captured to the clipboard.

I think I can do it with the wait for a key to be pressed and assign a couple of hot keys, but I would rather just click on the icon

This is what the script looks like for notepad


Any ideas on how to do this (if it can be done) would be appreicated

COF
GAW>win,x,y
SetFocus>%win%*
WaitReady>0
GetCaretPos>X,Y,0
Add>Y,10
MouseMove>X,Y
LDb
Press CTRL
Send c
Release CTRL
Wait> 0.1
Let>Clip=True
Getclipboard>dstring
MDL>%dstring%

Thanks in advance

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