Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running AutoHotkey 1.0.48.05 on Windows 7.

I have this script:

::sw::
    InputBox, providedString, SVN Switch, Switch the current directory to where?
    if NOT ErrorLevel
    {
        Send svn switch %providedString%{Enter}
    }
Return

So I if type sw{Enter} in PowerShell (or anywhere), I'll be prompted by a text box. Currently that text box is blank.

How can I prepopulate it with a particular string?

share|improve this question
up vote 1 down vote accepted

Syntax for Inputbox:

InputBox, OutputVar [, Title, Prompt, HIDE, Width, Height, X, Y, Font, Timeout, Default]

So what you want is to add a Default value:

::sw::
    InputBox, providedString, SVN Switch, Switch the current directory to where?,,,,,,,,<a particular string>
    if NOT ErrorLevel
    {
        Send svn switch %providedString%{Enter}
    }
Return
share|improve this answer
1  
Wow, I'd looked at the docs (autohotkey.com/docs/commands/InputBox.htm) but somehow hand't seen that. Thanks. – Ryan Sep 27 '12 at 17:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .