There are two ways your script can manage the display of a dialog.
The detached method is far more flexible and you will probably want to use this method most of the time but if you only have a simple dialog for the user to enter data with, the first method is a lot easier to use.
The Dialog object is the primary object for creating and displaying script dialogs. To display a script dialog with a Dialog object, set its template parameter to the name of the dialog before you call the Show method.
More: