Let´s say i have a line of code and i have a button, and when i press the button is insert a piece of text at the end of the line.
here is the code that i already have :/
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Gui, Add, Button, x12 y19 w100 h30 gtest, Button
Gui, Show, w138 h84, Untitled GUI
return
; here i want to
test:
Gui, Submit, NoHide
InsertLine("; Hi", "1.ahk", 10)
return
; FUnction
InsertLine(Line, File, Pos) {
FileRead, Content, %File%
Loop, Parse, Content, `n, `r
If (A_Index < Pos)
Front .= A_LoopField "`n"
Else
Back .= A_LoopField "`n"
FileDelete, %File%
FileAppend, % Front Line "`n" Back, %File%
}
GuiClose:
ExitApp