Made a little script that stores 9 diffrent mousepositions....
The script overwrites itself and reloads.
store with CTRL+SHIFT+1 to 9
use with CTRL+1 to 9
be sure to name the script file "SaveMousePos.ahk" (or change the code to match it)
Cred to Thalon for the ChangeLine()
http://www.autohotkey.com/forum/viewtopic.php?t=6910
Code:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
;This script uses relative mouse positions so a window need to be active so it can relate coordinates.....
CoordMode,Mouse,Relative ;hit the same spot in a window even if the window itself moves
;CoordMode,Mouse,Screen ;some may like this better
var_button=9
;;;;;;; see to it that u don't move lines 11 through 19.... will end up with duplicate hotkeys
^1::MouseMove,25,102 ; Win=0x370422 Control=Static1 Line Stored=20070616095710
;row will be replaced
;row will be replaced
;row will be replaced
;row will be replaced
^6::MouseMove,186,196 ; Win=0x370422 Control=Button19 Line Stored=20070616095713
;row will be replaced
;row will be replaced
;row will be replaced
;;;;;;;;;;;;;Don't use or delete rows 11 through 19 !!
;Store Mouse positions with CTRL+????+(1_to_9) Goto stored location with CTRL+(1_to_9)
^+1::
var_button-=1
^+2::
var_button-=1
^+3::
var_button-=1
^+4::
var_button-=1
^+5::
var_button-=1
^+6::
var_button-=1
^+7::
var_button-=1
^+8::
var_button-=1
^+9::
MouseGetPos, Var_X, Var_Y, Var_Win, Var_Control
ScriptLine=^%var_button%::MouseMove,%Var_X%,%Var_Y% %A_Tab% `; Win=%Var_Win% %A_Tab% Control=%Var_Control% %A_Tab% Line Stored=%A_Now%
var_button+=10 ;used to calculate what row to use....
ReplaceLine("SaveMousePos.ahk", var_button, ScriptLine)
Reload
ReplaceLine(File, LineNo, LineData)
{
FileRead, FileContent, %File%
FileDelete, %File%
Loop, parse, FileContent, `n, `r
{
if (A_Index = LineNo) {
LineContent = %LineData% ;Replace
}
else LineContent = %A_LoopField%
NewFileContent = %NewFileContent%`n%LineContent%
}
StringTrimLeft, NewFileContent, NewFileContent, 1 ;Otherwise first line would be empty
FileAppend, %NewFileContent%, %File%
}
may add a key to toggle between Relative and Screen...
EDIT: made a little more efficient script in the same spirit as the last...
EDIT: mr guests solution is UBER!
/Ricke