First, I was wondering if it was possible to open a txt file directly into code, like if I were to make a .txt with some lines like
Code: Select all
global A := [1,2]
global B := [10,20]
Two, I can't get this snippet to work. It won't write anything, and if I enter anything in the input box that has a space in it, it freaks out and says it's an illegal character, so how am I supposed to write spaces to a txt file?
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.
global TestFile := FileOpen("testingfile.txt","rw")
global NumbersToAdd := [100,200]
global ThingsToAdd := 4
^+0::
TestFile.Pos := 0
index := 0
while (index < ThingsToAdd)
{
index += 1
InputBox, testinput, Test, Put the number here, , 300,300
ToolTip %testinput%
TestFile.WriteLine(%testinput%)
}
FileRead, Readed, "testingfile.txt"
MsgBox %Readed%
return
Thanks in advance for the help!