AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need really simple script

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
snakkero
Guest





PostPosted: Sat Aug 01, 2009 2:30 pm    Post subject: Need really simple script Reply with quote

HI!
I`m looking for script for 2 hours, but can`t find. I need script that will click (left mouse button) on exactly point in new window, 1 second after opening. I hope you know what i mean. Could somebody make it?
Back to top
snakkero
Guest





PostPosted: Sat Aug 01, 2009 2:37 pm    Post subject: Reply with quote

Coordinates should be defined from left corner for every window, not whole screen (i don`t know, where exaxtly new window will open)
Back to top
TLM



Joined: 21 Aug 2006
Posts: 2926
Location: The Shell

PostPosted: Sat Aug 01, 2009 2:41 pm    Post subject: Reply with quote

Read MouseClick and CoordMode.
_________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞
Back to top
View user's profile Send private message
Eedis



Joined: 12 Jun 2009
Posts: 1158
Location: Indianapolis IN, USA

PostPosted: Sat Aug 01, 2009 9:46 pm    Post subject: Reply with quote

Code:
WinWaitActive, "Window Title" ;Replace the quotes with the window title.
Sleep, 1000 ;Waits for one second, in milliseconds.
CoordMode, Mouse, Relative ;Makes the coordinates of click relative to the active window.
MouseClick, L, "x", "y" ;Replace the quotes with the coordinates you want it to click.


Untested, but I'm sure that's what you wanted.
_________________
www.AutoHotkey.net/~Eedis
I love my wife and daughter so much.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
JDN



Joined: 24 Mar 2004
Posts: 299

PostPosted: Sun Aug 02, 2009 4:21 am    Post subject: Reply with quote

You should also read about the AHK Spy utility.

That will help you find the exact location of a specific point on the screen - like the upper left hand corner of a window - or the point on which you wish to click.
Back to top
View user's profile Send private message
snakkero
Guest





PostPosted: Sun Aug 02, 2009 8:10 pm    Post subject: Reply with quote

The coordinates of the point I can find myself. Script works with one window, but i would like something that will work with every new window that I open (and only one time, after opening, not every time when it`s active). Is it possibie?
Back to top
Fatal_Error



Joined: 24 Jul 2009
Posts: 13

PostPosted: Mon Aug 03, 2009 7:12 am    Post subject: Reply with quote

If you set the script up as a hotkey then yes. As for automation of this, a little more complicated. I might be able to devise a script for it, but I currently do not know how to do it and would have to look through the help file (very useful, go take a look!)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group