Visit nubAHK wiki today. It's online and open for discussions
well, since the ongoing discussion which ahk to prefer (chris ahk basic, or the all new ahk_l) wont find an end soon, i decided to start with something new.
its called nubAHK (pronounce new AHK). it comes with an all new syntax which is very non programming people oriented. here is a very first proof of concept script which translates a simple nubscript to ahk or ahk_l whatever will make the race
to try it out, save the script below as demo.nub
here is how the nubscript looks like:
hotkey "CTRL+X" you type "I CAN HAS HOTKEYZ AND AUTOTYPER!" done with hotkey hotkey "ESCAPE" done with script hotkey "CTRL+SPACEBAR" repeat 3 times from here you type "YEAH BABY!" wait for 1 second you type "I SAY YEA BABY!" wait for 0.5 second to here done with hotkey when i type "LOL" you type "ROFL"
here is a very simple parser which translates aboves nubscript (demo.nub) into plain old ahk but this may be later changed to whatever syntax you'll prefer, such as ahk_l, ia and who knows what else.
fileread, nub, demo.nub FileAppend,% n2a( nub ),% A_ScriptDir "\t.ahk" runwait % """" A_AhkPath """ /ErrorStdOut """ A_ScriptDir "\t.ahk""" If ( FileExist( A_ScriptDir "\t.ahk" ) ) FileDelete, % A_ScriptDir "\t.ahk" n2a( nub ) { global ahk ahk := "; nub2ahk PoC v 0.1 prealpha`n" nub := RegExReplace( nub, "sm)^(\t| )*", "" ) nub := RegExReplace( nub, "i)from here", "`n{" ) nub := RegExReplace( nub, "i)to here", "`n}`n" ) nub := RegExReplace( nub, "i)you type ""((""""|[^""])+)""", "send, % ""$1""" ) Loop,Parse,nub,`n,`r if ( RegExMatch( A_LoopField, "i)^\s*hotkey\b[^""]""([^""]+)""", hk ) ) { hk1 := RegExReplace( hk1, "i)(BAR|APE|DOWS)\b", "" ) hk1 := RegExReplace( hk1, "i)\bCTRL\b", "^" ) hk1 := RegExReplace( hk1, "i)\bALT\b", "!" ) hk1 := RegExReplace( hk1, "i)\bWIN?\b", "#" ) hk1 := RegExReplace( hk1, "\s*\+\s*", "" ) ahk .= _( RegExReplace(hk1,"(.*)","$L1") "::" ) } else if ( RegExMatch( A_LoopField, "i)^done with hotkey$" ) ) { ahk .= _( "return" ) } else if ( RegExMatch( A_LoopField, "i)^done with script$" ) ) { ahk .= _( "exitapp" ) } else if ( RegExMatch( A_LoopField, "i)^wait for (?P<time>\d+(\.\d+)?) (?P<unit>(sec(ond(s)?)?|min(utes)?|hours|hrs))", m ) ) { ahk .= _( "sleep, % " mtime " * " ( InStr( munit,"sec" ) ? "1000" : InStr( munit,"min" ) ? " 60 * 1000" : " 60 * 60 * 1000" ) ) } else if ( RegExMatch( A_LoopField, "i)^when i type[^""]""([^""]+)"" send, %[^""]""([^""]+)""", m ) ) { ahk .= _( "::" m1 "::" m2 ) } else if ( RegExMatch( A_LoopField, "i)^repeat (?P<rounds>\d+) times", m ) ) { ahk .= _( "Loop, " mrounds ) } else ahk .= _( A_LoopField ) return ahk } _(t){ global ahk return t ( strlen(ahk) == 0 ? "" : "`n" ) }
at the moment only simple (read basic) hotkeys, loops, sleeps, and hotstrings are supported.
tell me what you think about it.
greets
dR