Jump to content

Using WinGetCaretPos and MouseClick

Recommended Posts

Greetings all,

I'm trying to use WinGetCaretPos and MouseClick in concert. I *think* this should work, but it doesn't. Any ideas would be much appreciated.

;Below this fills out a field and moves the carat into the position to copy the x/y location

;LOCATION FIELD, I want this to grab the x coord position from the array and put it into the mouseclick below.
Local $aCaretPos3 = WinGetCaretPos()
local $sVariable1 = $aCaretPos3[0]

;plug the variable into the mouseclick. It changes every instance, so it needs to refresh with loop.
_WinWaitActivate("New service work order","")

;rest of script that works great.


Working script with carat trials.au3

Edited by Unholy_Pony

Share this post

Link to post
Share on other sites

WinGetCaretPos() returns position relative to foreground window but MouseClick() has absolute (desktop) position.

So you have to get position of your window by WinGetPos() and add your caret's X value to window's X value.

Edited by Zedna

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...