Here is some code that I used for the first record of the mouse position (the relative position of the mouse did not work, because the window was broken, and the click position could be changed by moving the tiles). Immediately after that, I click the mouse button at the recorded position (and repeat it later in the code).
SplashTextOn, 200, 100, Script Preparations, Please Click on the Person `"Search Term`" link (1) in SAP. ; Show new instructions to the user WinMove, Script Preparations,, (A_ScreenWidth/2)-150, (A_ScreenHeight/2)-200 ; Move the text instructions window with the name "Script Preparations" 150 pixels right of the center of the screen and 200 pixels up SoundBeep 600, 300 ; Wake up user ; From here on the left mouse button will temporarily be disabled Hotkey, LButton, on ; Turn Left Mouse Button OFF, to capture the Mouse click KeyWait, LButton, D ; Wait for LeftMouseButton click Down MouseGetPos, xposS ,yposS ; Store the position where the mouse was clicked (Search Box) MouseClick, left, %xposS% ,%yposS% ; Perform the mouse click on the captured mouse location
Hope this helps.
In your situation, I assume that you only need to determine the position of the mouse using Window Spy.
source share