message hscript command
Presents text to the user.
Usages
message [-b button1,button2 [-p] [-d num] [-h help] [-t title]] text
In a non- graphical application such as the hscript standalone application, this command is similar to the echo command except that the text will always be displayed in the console, even if the command output is being redirected to a file or elsewhere.
In a graphical application such as Houdini, this command brings up a dialog box with the specified text. All further commands and processing are stopped until the user dismisses the dialog.
Options
-h help | Provides supplementary text to print with the message. Use single quotes to encapsulate messages containing spaces. |
-t title | Give the dialog box a custom title caption. Use single quotes to encapsulate messages containing spaces. |
-b button1,button2 [-p] [-d num] | Adds buttons to the dialog box or prints choices in non-graphical applications. The choices are comma separated and if they contain spaces, they need to be all encompassed in quotes. The command returns the choice that the user selected (starting with 0 for the first, 1 for second, etc.). If an error occurred, like end of file in non-graphical applications, then -1 is returned. |
-d num | Specifies the index to use as a default choice. |
-p | This option causes this command to print (return) the label of the pressed button instead of its index. |
Examples
message Some informative message
message -b Yes,No -d 0 Would you like to proceed?
message -b "Save and Exit,Discard and Exit,Cancel" -d 0 Your choice?
message -b Retry,Cancel -h 'Ensure that the destination path exists and is not write-protected.' -t 'Save Error' Cannot save the file to the specified location.
set x = `run("message -b yes,no some message")`
Replaced by
Replaced by hou.ui.displayMessage
