In response to https://nolongerset.com/all-about-indenting/

::ThisPath::ThisWorkbook.Path & Application.PathSeparator ::ppg::Public Property Get ::with::With {End}{Enter}End With{up}{end} :*:then`n::Then{Enter}{Enter}End If{up 1}`t ::forarray::For i = LBound(arr) to UBound(arr){Enter}{Enter}Next i{up}`t :*:for :: ;when you type for{space}, replace it with caps so you know you're in AHK mode SendInput FOR{Space} ;wait for the next word and store it in counter Input, counter,I V T10,{Space}{Escape} ;finish with ESC and you thwart AHK ;but finish with a space and more stuff happens if (ErrorLevel = "EndKey:Space") { ;if the next word is each, it's a for each loop if (counter = "each") { ;wait for the next word and store it in eachctr Input, eachctr, I V T10,{Space}{Escape} if (ErrorLevel = "EndKey:Space") { ;Once you know eachctr, fill in the Next line and go back up to the For line SendInput +{HOME}{DELETE}{Enter}Next %eachctr%{Up}For Each %eachctr%{Space} } } ;if the next word is one of these, you're opening a text file else if (counter = "Append" or counter = "Binary" or counter = "Input" or counter = "Output" or counter = "Random") { ;get the next word - it really should only be 'As' Input, askeyword, I V T10,{Space}{Escape} if (ErrorLevel = "EndKey:Space") { if (askeyword = "As") { ;the word after 'As' is the file number Input, filenum, I V T10,{Enter}{Escape} if (ErrorLevel = "EndKey:Enter") { ;complete the close statement, because I always forget that. SendInput {Enter}Close{Space} ;you got to send this part raw because there may be a # in there and that's special SendRaw %filenum% SendInput {Up} } } } } else { ;and finally if it's not all that special stuff, it's just a for next SendInput +{HOME}{DELETE}{Enter}Next %counter%{Up}For %counter%{Space} } } else { ;thwarted, so get rid of caps SendInput {bs 4}for{Space} } Return :*:do`n:: sendinput Do{Enter 2}Loop{Up}{Tab}{Down}{End}{Space} Return :*:do until :: sendinput DO UNTIL{Enter}Loop{Up}{End}{Space} Return :*:do while :: sendinput DO WHILE{Enter}Loop{Up}{End}{Space} Return :*:.eof:: sendinput .EOF{Enter}{Enter}{Tab}.MoveNext{Up}{Tab} Return :*:Input(:: sendinput Input$(lof(lfile),lfile) Return :*:Input$(:: sendinput Input$(lof(lfile),lfile) Return