In response to https://nolongerset.com/all-about-indenting/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
::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 |
Hi Dick,
Nice to see a post! I’m intrigued, what does it do?
From the https://nolongerset.com/all-about-indenting/ comments this appears to be the ahk file for AutoHotkey (https://www.autohotkey.com/)
It’s called AutoHotkey, not “AutoHotKey”
I never noticed that. Thanks. Fixed.