AutoHotkey Community

It is currently May 26th, 2012, 2:45 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: ifwinactive
PostPosted: January 28th, 2009, 3:37 pm 
Offline

Joined: June 16th, 2007, 3:23 am
Posts: 280
If this can work, I have that window appear once in a while
Code:
ifwinactive EasyTune5 Build
{
MouseClick, left,  280,  14
Sleep, 100
MouseClick, left,  253,  116
Sleep, 100
}

**************ALSO************
Also I have a problem I gosub to a tag
Code:
 a(increment number): then,
 I do  a++

But sometime he repeat the same tag, who can I make sure the ++ work and he just to the next tag all the time.

Thanks


Last edited by feejo on January 28th, 2009, 4:03 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2009, 3:53 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5478
Location: the tunnel(?=light)
I assume for your first problem you have a window pop up and you're clicking some other button then OK to get rid of the window? If so it would probably be better to set a timer to run your command every few seconds. For example (I added a little to it):

Code:
SetTimer, EasyTuneClose, 2000 ; runs the EasyTuneClose subroutine every two seconds

EasyTuneClose:

IfWinActive EasyTune5 Build
{
 MouseGetPos Px, Py ; retrieves the mouse's current position
 Click  280,  14
 Click %Px%, %Py%, 0 ; moves the mouse back to its original position without clicking
 Sleep, 100
 Click  253,  116
 Click %Px%, %Py%, 0 ; moves the mouse back to its original position without clicking
 Sleep, 100
}
else
 return


Optionally, you could examine the EasyTune5 Build window with Window Spy to determine if the things you are clicking are controls. If they are, you can substitute the Clicks for ControlClicks and avoid using the MouseGetPos and Click %Px%, %Py% statements I added.

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: G. Sperotto, patgenn123 and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group