Difference between revisions of "$input"
From Scriptwiki
m (added See Also) |
(t for star icon) |
||
Line 18: | Line 18: | ||
** v - Return "$ok" "$yes" "$no" "$retry" or "$cancel" instead of [[$true]] or [[$false]]. Cancel and no still return [[$null]] when used with e. | ** v - Return "$ok" "$yes" "$no" "$retry" or "$cancel" instead of [[$true]] or [[$false]]. Cancel and no still return [[$null]] when used with e. | ||
** g - Aligns buttons to the right instead of centering them. | ** g - Aligns buttons to the right instead of centering them. | ||
− | ** | + | ** iqwht - Shows the info, question, warning, hand and star icons respectively. |
** d - Plays system sound associated with the specified icons. | ** d - Plays system sound associated with the specified icons. | ||
** s - Indicates that a window has been specified. | ** s - Indicates that a window has been specified. |
Revision as of 23:26, 25 August 2008
Input is a multi-purpose identifier for requesting input from a user in an auto-rendered pop up dialog, similar to $?.
$input(prompt [,options] [,window] [,title] [,text])
- Prompt is the text you wish to display to the user. This is usually to tell the user what you wish to be inputted. You may use a $crlf to force a line break.
- Options is a list of option flags. Defaults to an "OK" and "Cancel" button which return $true or $false respetively.
- e - Show an editbox for input. "OK" and "Cancel" are default buttons. $null is returned if "Cancel" is pressed, and the text is returned if "OK" is pressed.
- o - Show an "OK" button.
- y - Show a "Yes" and "No" button.
- n - Show a "Yes" "No" and "Cancel" button.
- r - Show a "Retry" and "Cancel" button.
- v - Return "$ok" "$yes" "$no" "$retry" or "$cancel" instead of $true or $false. Cancel and no still return $null when used with e.
- g - Aligns buttons to the right instead of centering them.
- iqwht - Shows the info, question, warning, hand and star icons respectively.
- d - Plays system sound associated with the specified icons.
- s - Indicates that a window has been specified.
- a - Actives the input dialog automatically.
- u - Uses the current window as the parent. Do not use with "s" or if a window has been indicated.
- kN - Gives the user N seconds to respond. If they do not, either $null is returned (used with e), $timeout is returned (used with v), or $false is returned.
- Title is the title you wish to give the input dialog box.
- Text is the default text to be entered when used with "e"
Note
This identifier cannot be used in a script event. One way around this is to use /scon or a /timer to initiate an input request after the script ends.
Example:
on *:text:Foo:#:{ /timer 0 0 echo -a $?="Bar?" }