This section describes how you can directly interact with the user.
alert(<message>[,<title>[,<icon>]]);
Shows a simple messagebox.
Parameters:
| Parameter | Required | Type | Value | Meaning |
|---|---|---|---|---|
| <message> | YES | STRING | A message(1) | The text to be displayed in the dialog's body. |
| <title> | NO | STRING | A title(2) | The text to be displayed in the dialog's title bar. |
| <icon> | NO(3) | PREDEFINED | EXCLAIM | The icon to be displayed in the dialog's body. |
| INFO | ||||
| STOP | ||||
| QUESTION |
(1) The message can span several lines.
(2) The title cannot span several lines.
(3) When <icon> is specified, <title> must be specified too.
$button=confirm(<message>[,<title>[,<buttons>[,<icon>]]]);
Shows a confirmation box and returns the name of the pressed button: ABORT, IGNORE, NO, OK, RETRY, YES or 0 (for CANCEL).
Parameters:
| Parameter | Required | Type | Value | Meaning |
|---|---|---|---|---|
| <message> | YES | STRING | A message(1) | The text to be displayed in the dialog's body. |
| <title> | NO | STRING | A title(2) | The text to be displayed in the dialog's title bar. |
| <buttons> | NO(3) | PREDEFINED | ABORTRETRYIGNORE | The buttons to be displayed in the dialog's body. |
| OKCANCEL (default) | ||||
| RETRYCANCEL | ||||
| YESNO | ||||
| YESNOCANCEL | ||||
| <icon> | NO(4) | PREDEFINED | EXCLAIM | The icon to be displayed in the dialog's body. |
| INFO | ||||
| STOP | ||||
| QUESTION |
(1) The message can span several lines.
(2) The title cannot span several lines.
(3) When <buttons> is specified, <title> must be specified too.
(4) When <icon> is specified, <buttons> must be specified too.
$input=prompt(<message>[,<title>[,<preset>]]);
Shows an input box and returns a string (which is empty when the user canceled).
Parameters:
| Parameter | Required | Type | Value | Meaning |
|---|---|---|---|---|
| <message> | YES | STRING | A message(1) | The text to be displayed in the dialog's body. |
| <title> | NO | STRING | A title(2) | The text to be displayed in the dialog's title bar. |
| <preset> | NO(3) | STRING | A preset | The text to be displayed in the dialog's input field. |
(1) The message cannot span several lines here!
(2) The title cannot span several lines.
(3) When <preset> is specified, <title> must be specified too.
$path=promptforfile(<folder>,<fileType>,<fileMask>);
Shows the "Open File" Dialog and returns a path (which is empty when the user canceled).
Parameters:
| Parameter | Required | Type | Value | Meaning |
|---|---|---|---|---|
| <folder> | YES | STRING | A folder path(1) | The dialog's initial folder. |
| <fileType> | YES | STRING | A file type | Describes the files of interest e.g. "HTML Documents". |
| <fileMask> | YES | STRING | A match pattern | Specifies the files of interest e.g. "*.htm". |
(1) When an empty string, the OS will choose a folder.
$path=promptforfolder([<message>[,<folder>]]);
Shows the "Browse For Folder" Dialog and returns a path (which is empty when the user canceled).
Parameters:
| Parameter | Required | Type | Value | Meaning |
|---|---|---|---|---|
| <message> | NO(1) | STRING | A message | The text to be displayed in the dialog's body. |
| <folder> | NO(2) | STRING | A folder path | The dialog's initial folder. |
(1) Must be specified when <folder> is specified.
(2) When omitted, the OS will choose a folder.