Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Persistent
- #SingleInstance Force
- ; === CONFIGURATION ===
- FilePath := "C:\Users\thoma\OneDrive\Desktop\lister.txt" ; path to your text file
- ProgressFile := "C:\Users\thoma\OneDrive\Desktop\progress.txt" ; where the script remembers last line
- Delay := 600000 ; 15 minutes = 900000 ms
- ; === HOTKEY ===
- F1::
- if !FileExist(FilePath) {
- MsgBox, 16, Error, File not found: %FilePath%
- return
- }
- FileRead, FileContent, %FilePath%
- if ErrorLevel {
- MsgBox, 16, Error, Could not read the file.
- return
- }
- Lines := StrSplit(FileContent, "`n")
- ; Read saved progress
- if FileExist(ProgressFile) {
- FileRead, LastLine, %ProgressFile%
- if (LastLine = "")
- LastLine := 0
- } else {
- LastLine := 0
- }
- ; Start from next line
- StartIndex := LastLine + 1
- Loop % Lines.MaxIndex()
- {
- Index := A_Index
- if (Index < StartIndex)
- continue
- Line := Trim(Lines[Index])
- if (Line = "")
- continue
- SendInput, now a %Line%
- SendInput, {Enter}
- ; Save progress
- FileDelete, %ProgressFile%
- FileAppend, %Index%, %ProgressFile%
- Sleep, %Delay%
- }
- MsgBox, 64, Done, Finished typing all lines!
- return
- f2::reload
Advertisement
Add Comment
Please, Sign In to add comment