Hello,
I know I can jump cursor to (Go to) specific line and column numbers on a Notepad window by sending multiple sequence of up/down/right/left keys to a notepad window.
Is there a more straightforward/high-performing way to achieve this (may be like send message or something) that gets me instantly there and something that's more error-free?
Jump cursor to line number & column number on Notepad window?
Re: Jump cursor to line number & column number on Notepad window?
Code: Select all
JumpInNotepad(7,3) ; row,column ( column is optional )
ExitApp
JumpInNotepad(row,col:=1) {
ControlGetText,ovar,Edit1,ahk_class Notepad
arr := StrSplit(ovar, "`n" , "`r")
char := 0
for k, v in arr {
if (k < row )
char += StrLen(v) +2
}
ControlGet, hCtl, Hwnd,, Edit1, ahk_class Notepad
if col > 1
char += col-1
SendMessage, 0xB1, % char, % char, ,ahk_id %hctl%
}
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode