WileECoyote
Joined: 04 Nov 2005 Posts: 9
|
Posted: Tue Nov 22, 2005 2:01 pm Post subject: popup window for short scripts |
|
|
a small script which opens an edit window and executes the contents as ahk script. remembers the contents for the next activation. using a hotkey to launch the script lets you do virtually anything by just typing in the right commands.
christian
| Code: |
FileRead, COMMAND, %TEMP%\execute!.ahk
if ErrorLevel <> 0
COMMAND=SoundPlay, %SystemRoot%\Media\ding.wav, wait
Gui, add, text,, Code to execute:
Gui, Add, Edit, r9 vMyEdit, %COMMAND%
Gui, add, button, default, &Execute ; The label ButtonExecute (if it exists) will be run when the button is pressed.
Gui, add, button, X+15, &Cancel
Gui, show,, AutoHotkey Code Execution
return ; End of auto-execute section. The script is idle until the user does something.
ButtonExecute:
Gui, submit ; Save the input from the user to each control's associated variable.
FileDelete, %TEMP%\execute!.ahk
FileAppend, %MyEdit%, %TEMP%\execute!.ahk
Run, %TEMP%\execute!.ahk
GuiClose:
ButtonCancel:
ExitApp
|
|
|
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Tue Nov 22, 2005 11:23 pm Post subject: |
|
|
So simple! Thanks for posting it. I just hid the buttons and added your script to my main one. Now, if I need to know how many days are between two dates, I just fire the GUI and type | Code: | d = 20050611
d-= 20041212,days
MsgBox % d |
|
|