| View previous topic :: View next topic |
| Author |
Message |
Beastmaster Guest
|
Posted: Sun Mar 21, 2004 11:06 am Post subject: InputBox II |
|
|
Maybe I've overseen it (?)
Is there a default value possible @ an AHK input box ???
Here's a sample syntax from another scripting tool :
-----
| Quote: | Input>variable,prompt[,default_value]
Displays a dialog box to request information from the user. The dialog box displays the prompt specified in prompt and accepts input into variable. Optionally, a default value can be specified.
The Input box now also has a file browse button, making it useful for accepting filenames from the user.
If the Input dialog is cancelled (cancel is pressed) Input returns an empty string.
prompt can be a variable, containing the prompt to display.
It is possible to mask the value entered by the user with asterisks by setting the INPUT_PASSWORD variable to 1. Set to zero for default behaviour. |
-----
The file browse button could be a nice feature, but shouldn't be part of the InputBox by default.
Maybe an advanced switch like H=Hide, F=FileBrowse ?
InputBox, OutputVar [, Title, Prompt, Default_value, H/F] |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sun Mar 21, 2004 12:53 pm Post subject: |
|
|
Having a default value is a good idea. I'll try to get that into this upcoming version (due around Tuesday) or the one after that.
However, the need to select a file in InputBox seems rare. Would FileSelectFile meet your needs? Perhaps I should add an option for a default value in FileSelectFile as well. |
|
| Back to top |
|
 |
Beastmaster Guest
|
Posted: Wed Mar 24, 2004 9:30 am Post subject: |
|
|
A workaround for those who can't wait any longer
SetEnv, PathVar, C:\WinNT\System32
MsgBox, 36, Install Path Confirmation, We'd install XY on C:\WinNT\... `nPlease confirm, 10
IfMsgBox, NO, Goto, Input
.
.
.
Input:
Inputbox, PathVar, Install Path Confirmation, Please input the path where XY should be installed.
.
.
. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Thu Mar 25, 2004 11:16 pm Post subject: |
|
|
There's an example in SetTimer of how to provide a default value for InputBox. I still intend to add the feature to the next release, but in the meantime this might help:
http://www.autohotkey.com/docs/commands/SetTimer.htm |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Mar 26, 2004 11:51 am Post subject: |
|
|
As always,
thank you CHRIS! for these ingeniuous new commands (i.e. SetTimer). |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Fri Apr 23, 2004 6:06 pm Post subject: |
|
|
With respect to this topic, I added a few things to the Installer, which you can redownload if you wish. I hope to release the next version early next week. Also, I plan to start updating the change log more often, or somehow changing the way releases are done so that the version number doesn't always stay the same.
Improved InputBox with an optional timeout, as well as a default string for the edit field. [thanks Beastmaster]
Improved FileSelectFile to optionally provide a default filename in the dialog's edit field. [thanks Beastmaster]
Improved FileSelectFolder to optionally provide an edit field for the user to type the name of a folder.
OTHER CHANGES:
Fixed Run & RunWait on Windows 95/98/Me: They would sometimes incorrectly report a failure.
Removed the "Hook is not supported" warning message when a hook script is launched on Win9x.
Improved Send so that it obeys #HotkeyModifierTimeout even when the Send isn't called from a hotkey subroutine (e.g. called from a timer).
Improved the mouse click commands so that you can use just the first letter of the button name (L/R/M). [thanks Rajat]
Improved parsing loops with built-in handling for CSV (comma separated value) format. [thanks Robert Yaklin]
Improved the security of compiled scripts. If preventing hackers from viewing the source code of your compiled scripts is important, recompile the affected scripts with this version. [thanks Rajat]
Added the ability to show/hide the tray icon *while the script is running*. [thanks beardboy] See the menu command.
Added an option that allows the main window of a *compiled script* to become accessible. [thanks beardboy] See the menu command. |
|
| Back to top |
|
 |
beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Sat Apr 24, 2004 6:42 am Post subject: |
|
|
| Quote: | Improved InputBox with an optional timeout, as well as a default string for the edit field. [thanks Beastmaster]
Improved FileSelectFile to optionally provide a default filename in the dialog's edit field. [thanks Beastmaster] |
Am I just not seeing it or were these left out on the last Help File (04/23/04 10:11am)? |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Apr 24, 2004 12:17 pm Post subject: |
|
|
| They should be in there (they're in my copy, I just installed again to make sure). FileSelectFile's is listed in its RootDir parameter (since it's combined with that parameter). |
|
| Back to top |
|
 |
|