Monitor Submission Scripts


Monitor submission scripts are used to create custom submission dialogs in the Monitor's Submit menu. Installing and building your custom dialogs is quite simple, just follow the steps below.


Installing Your Monitor Submission Script

To install a new Monitor submission script, follow these steps. If you need to see an example, look at the existing Monitor submission scripts that were installed with the Deadline Repository.

1. Open the \\your\repository\scripts\Submission folder.

2. Create a new folder to store your submission script. The name of the folder will be the name of the menu item for your script in the Monitor.

Note that all underscores in the folder name are replaced with spaces in the menu item.

3. Open the new folder, and create a vbscript file using the new folder's name as the filename prefix.

For example, if the new folder's name was My_Script, the vbscript file should be called My_Script.vbs.

4. As an option, you can create a 16x16 icon file that will appear next to the menu item, and place it in the new script folder. Just give the icon file the same filename prefix as the vbscript file.

For example, if your vbscript file is called My_Script.vbs, the icon file should be called My_Script.ico.

5. Now if you reopen or refresh the monitor, you should see a menu item in the Submit menu for your submission script, even if the script file is empty. Of course, clicking the menu item for you script will do nothing at this point.

Building Your Monitor Submission Script

For a complete example of a custom submission script, see the Submission_Dialog_Example script that's included with Deadline. You should take a look at the other submission scripts included as well.

We follow a specific template when building the submission scripts that are included with Deadline. The Monitor submission script template is as follows.

1. Build The Submission Dialog

You build your submission dialog by adding controls to a global ScriptDialog object. Each control's name must be unique, so that each control can be identified properly.

You can also set the dialog's size, title, and a few other settings. See the reference section for a complete list of dialog functions and controls.

2. Define And Load Your Sticky Settings

Sticky settings are settings that persist after the dialog has been closed. They are defined by creating an array which contains the names of the controls you wish to save settings for.

After defining them, you can load them by calling the ScriptDialog function LoadSettings.

3. Show The Dialog

Show the dialog to the user using the ScriptDialog function ShowDialog.

4. Specify Your Callbacks

Callbacks are Subs that are called when the value for a particular control in your dialog is changed. This allows you to react to user input as you see fit. The Sub name for each callback is OnControlNameValueChanged(), where ControlName is the name of the dialog control.

There is also a global callback OnDialogClosing(), which is called when the user clicks on the X button in the top-right corner of the dialog.

If you have a callback for when the dialog is closing, it is a good idea to save the sticky settings here using the ScriptDialog function SaveSettings.

5. Specify Your Functions

Specify any functions that may be used by your callbacks, or when you are building the dialog.

Monitor Submission Script Reference

The Monitor submission scripts use a ScriptDialog object to create and control the submission dialog.

ScriptDialog Functions

These functions are called by using ScriptDialog.function

Function Description
void Reset() Clears everything in the dialog.
void Restore( bool Normal ) If Normal is True, the dialog is restored, other wise it is minimized.
void SetSize( int width, int height ) Sets the size of the dialog. Width and height are in pixels.
void SetTitle( string title ) Sets the title for the dialog.
void SetTopMost( bool value ) Sets whether or not the dialog should be the top most window.
void SetShowInTaskBar( bool value ) Sets whether or not the dialog should appear in the taskbar.
void Show() Shows the script dialog as a non-modal dialog.
void ShowDialog() Shows the script dialog as a modal dialog.
void ShowDialogRestored() Shows the script dialog as a modal dialog in the restored state.


void AddControl( string name, string type, variant defaultValue, string label ) Adds a basic control to the dialog. You must specify a name (unique), the control type, the default value, and the label text.
void AddBrowserControl( string name, string type, variant defaultValue, string filter, string label ) Adds a browser control to the dialog. You must specify a name (unique),

the control type, the default value, the filename filter text, and the label

text.
void AddRangeControl( string name, string type, float defaultValue, float min, float max, int decimals, float increment, string label ) Adds a range control to the dialog. You must specify a name (unique),

the control type, the default value, the minimum and maximum values,

the number of decimal places, the increment amount, and the label text.
void AddComboControl( string name, string type, variant defaultValue, array items, string label ) Adds a combo box control to the dialog. You must specify a name (unique),

the control type, the default value, the list of combo box items, and the label

text.
void AddRadioControl( string name, string group, bool defaultValue, string label ) Adds a radio button control to the dialog. You must specify a name (unique), the group the radio button belongs to, the default value, and the label text.
void AddRow( int controlCount ) Add a new row to the dialog, where controlCount is the number of controls that will be added to the row.
void Endrow() Ends the current row. Should be called after the controls have been added to the current row.
void AddTabControl( string Name ) Add a new tab control to the dialog, where Name is the tab's name. Tabs can be added using the AddTab and EndTab functions.
void EndTabControl() Ends the current tab control. Should be called after the tabs have been added to the current tab control.
void AddTab( string Name ) Add a new tab to the current tab control, where Name is the text that appears on the tab.
void EndTab() Ends the current tab. Should be called after the controls have been added to the current tab.


variant GetValue( string name ) Returns the value of the control identified by the name specified.
void SetValue( string name, variant value ) Sets the value of the control identified by the name specified.
bool GetEnabled( string name ) Returns whether or not the control identified by the name specified is enabled.
void SetEnabled( string name, bool enabled ) Sets whether or not the control identified by the name specified is enabled.
array GetItems( string name ) Returns the items in the combo box control identified by the name specified.
void SetItems( string name, array items ) Sets the items in the combo box control identified by the name specified.
void LoadSettings( string filename, array controlNames ) Loads the sticky settings for the controls specified in the controlNames.
void SaveSettings( string filename, array controlNames ) Saves the sticky settings for the controls specified in the controlNames.

ScriptDialog Controls

These are the different controls that can be added to the dialog.

Control Type Control Group
SeparatorControl Basic
LabelControl Basic
TextControl Basic
ReadOnlyTextControl Basic
CheckBoxControl Basic
RadioControl Basic
ButtonControl Basic
PoolComboControl Basic
CategoryComboControl Basic
JobDependencyControl Basic
LimitGroupControl Basic
WatchUsersControl Basic
FileBrowserControl Browser
MultiFileBrowserControl Browser
FileSaverControl Browser
FolderBrowserControl Browser
RangeControl Range
SliderControl Range
ComboControl Combo