
OMG I never thought of that! That's awesome! Time to go brainstorm the implications...
Aha! People of the AutoHotkey forum, I give you: The vbs2ahk converter! It's really not significant enough to warrant it's own thread, but hey, maybe someone will find it useful. If someone actually cares, I can spiff it up a bit, maybe add support for multiple files at once, and then release it.
Code:
; vbs2ahk script by jonny (copyright everyone)
;
; This script will convert a vbs file into an ad hoc ahk script.
; This does NOT embed the code or convert the code itself to AHK,
; it merely runs the script internally.
;
; It can be run by running the script alone, using dialogs, or
; through the command line. If you use the command line, you must
; include all the parameters or the script will commit honorable
; seppuku. These parameters are,
;
; 1) The input vbs. This can be a relative or absolute path.
; 2) The output ahk. This, too, can be relative or absolute.
; 3) Time in milliseconds to wait for the vbs script to run.
;
; Example: vbs2ahk.exe Shutdown.vbs Shutdown.ahk 1000
;
; No registration required. :-D
If 0 > 0
{
vbs_from = %1%
vbs_to = %2%
vbs_wait = %3%
}
Else
{
FileSelectFile, vbs_from, 3,, Choose the vbs to convert., VBScript (*.vbs)
If vbs_from =
ExitApp
Else
{
InputBox, vbs_to, vbs2ahk, Choose a name for the output ahk.
InputBox, vbs_wait, vbs2ahk, Specify a time in milliseconds to wait for the script to run.`nThis may vary with the size of the script.
}
}
FileAppend, FileAppend`,, %vbs_to%
Loop, Read, %vbs_from%
{
FileAppend, %A_LoopReadLine%``n, %vbs_to%
}
FileAppend, `, 9temp9.vbs`nRun`,9temp9.vbs`nSleep`,%vbs_wait%`nFileDelete`,9temp9.vbs`nReturn,%vbs_to%
Return