I went a little kookie with this! If you position the mouse and press 'capslock' it will store the current mouse x,y. If you press 'ctrl+capslock' it will save the list of x,y coords along with the current screen width and height. Press 'alt+capslock' (maybe on another computer or after changing resolution) to play back the recorded mouse x,y clicks scaled to the current screen width and height. It will not actually click at the scaled coords now, but will use outputdebug to demonstrate.
Code:
Return
CapsLock:: ;press capslock (do not click with the mouse) to record a click to be scaled; it will be added to the queue
CoordMode, Mouse, Screen
MouseGetPos, x, y
storedClicks := storedClicks ? storedClicks . "`n" . x . "|". y : x . "|". y
Return
^CapsLock:: ;control+capslock stores the series of clicks
FileDelete, clicks.txt
;screen height and width on computer this was recorded
FileAppend, %A_ScreenWidth%|%A_ScreenHeight%¶, clicks.txt
FileAppend, %storedClicks%, clicks.txt
OutputDebug, %storedClicks%
Return
!CapsLock:: ;alt+capslock plays back the scaled click queue
FileRead, queue, clicks.txt
StringSplit, q, queue, ¶ ;separate the original screen from the click data
StringSplit, origWH, q1, | ;split the x,y coords (w=origWH1, h=origWH2)
StringSplit, clicks, q2, `n ;split the clicks
Loop, % clicks0
{ StringSplit, coord, clicks%A_Index%, | ;x=coord1, y=coord2
coord1 += 0 ;make sure they are numbers
coord2 += 0
scaleX :=(A_ScreenWidth * coord1) / origWH1 ;scale the coords
scaleY := (A_ScreenHeight * coord2) / origWH2
OutputDebug, origX: %coord1% > scaledX: %scaleX%
OutputDebug, origY: %coord2% > scaledY: %scaleY%
OutputDebug, ___________________________
;~ Click, %scaleX%, %scaleY%
}
Return