Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i never write an autohotkey script with a GUI, so i'm a little lost about how can i achieve what i want. I need that after pressing a hotkey opens a empty textbox that let me write anything until i press Enter. That key will close the textbox and somehow save that text in a variable.

thanks

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

after a couple of minutes of reading autohotkey documentation Autohotkey GUI i create what i need

#SingleInstance, force
#o::
Gui, Add, Edit, vMyEdit -WantReturn
Gui, Add, Button, Default, OK
Gui, Show
return

Escape::
Gui, Destroy
return

GuiClose:
Gui, Destroy
return

ButtonOK:
Gui, Submit
SendInput <%MyEdit%>{Enter 2}</%MyEdit%>{Up}{Tab}
Gui, Destroy
Return

Also one can use an InputBox but i don't find how can subscribe the Escape key to kill the popup window, so i stick with this long but functional script.

share|improve this answer
    
So, have you answered your original question? –  martineau Feb 20 '11 at 16:10
    
BTW, you don't need to "subscribe the Escape key" for an InputBox. Typing Esc does the same thing as pressing the Cancel button (and kills the popup window). –  martineau Feb 20 '11 at 16:11
    
@martineau your right, it doesn't work because i have running at the same time this other script, xD...thanks –  mjsr Feb 20 '11 at 20:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.