Skip to content

Instantly share code, notes, and snippets.

@dimm0k
Forked from TLMcode/BasicScriptStarter.ahk
Created July 26, 2013 02:55
Show Gist options
  • Save dimm0k/6085751 to your computer and use it in GitHub Desktop.
Save dimm0k/6085751 to your computer and use it in GitHub Desktop.
CoordMode, ToolTip, Screen
reStart:
InputBox, scriptName, Name of New Script, % "Current AHK version is: AHK"
. ( InStr( A_AhkVersion, "1.0." ) ? "Basic " : InStr( A_AhkVersion, "1.1." )
? "_L " : "Unknown " ) A_AhkVersion,,, 130
If ( ErrorLevel )
ExitApp
Else If ( !scriptName ) {
MsgBox, You Didn't Enter A Name!
GoSub, reStart
}
Dir := A_MyDocuments "\ACTIVE AHK SCRIPTS\AHK_" scriptName
File := Dir "\" scriptName ".ahk"
If FileExist( File ) {
MsgBox, That File Name Aleady Exists!
GoSub, reStart
}
FileCreateDir, % Dir
FileAppend, % "F1::`r`n`r`n`r`n/*`r`n`r`n*/`r`nReturn`r`n`r`nF2::Reload`r`n`r`n"
. "ESC::ExitApp" a_tab "; <-- Press escape to exit."
. "`r`n`r`n", % File
While !FileExist( File ) {
ToolTip % "Generating AHK file " scriptName ".ahk ." d.="." ( StrLen(d)>10 ? d:="" : "" ), 10, 10
Sleep, 100
}
Run, % Dir
WinWait, % Dir
Run, Notepad.exe %File%,,, npPid
WinWait, % "ahk_pid " npPid
ControlSend, Edit1, {down 2}, % "ahk_pid " npPid
Run, % File
Exitapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment