User Tools

Site Tools


script-dialogs

Dialogs example

The scripting language supports user interaction by the means of message, question, progress, and selection dialogs.

/**
 * Message dialogs example.
 * Author: Camera Controller
 * Web: http://www.tequnique.com/cameracontroller
 * Description: This example shows different message dialog types which can be used in scripts.
 */
 
// Progress dialog
showProgressDialog("Info", "This is a progress dialog which will close in 2 seconds.");
waitMilliseconds(2000);
hideProgressDialog();
 
// Question dialog
var result = showQuestionDialog("Question", "Show text input?");
if (result) {
    // Text input dialog
    var text = showTextInputDialog("Info", "What is your name?", "");
    showMessageDialog("Info", "Your name is: " + text);
}
else {
    // List selection dialog
    var choices = ["A", "B", "C"];
    var selectedIndex = showListSelectionDialog("title", ["A", "B", "C"], 1);
    if (selectedIndex > -1) {
        showMessageDialog("Info", "Selected item: " + choices[selectedIndex]);
    }
}
script-dialogs.txt · Last modified: 2018/04/02 08:41 by teq