User Tools

Site Tools


Global

Global objects, methods, variables and constants available to all scripts via the global namespace.

More...

Properties

Methods

ECMAScript
StringdecodeURI ( String encodedURI )
StringdecodeURIComponent ( String encodedURIComponent )
StringencodeURI ( String uri )
StringencodeURIComponent ( String uriComponent )
Objecteval ( String str )
BooleanisFinite ( Object expression )
BooleanisNaN ( Object expression )
NumberparseFloat ( String str )
NumberparseInt ( String str, Number radix )
QtScript
voidgc ()
voidprint ( String expression )
StringqsTr ( String sourceText, String disambiguation=“”, Number n=-1 )
StringqsTranslate ( String context, String sourceText, String disambiguation=“” )
StringqsTrId ( String id, Number n=-1 )
StringQT_TR_NOOP ( String sourceText )
StringQT_TRANSLATE_NOOP ( String context, String sourceText )
DAZ Script
voidacceptUndo ( String caption )
BooleanbackgroundProgressIsActive ()
BooleanbackgroundProgressIsCancelled ()
voidbeginNodeSelectionHold ()
voidbeginUndo ()
voidbeginViewportRedrawLock ()
voidcancelBackgroundProgress ()
voidcancelProgress ()
voidcancelUndo ()
voidclearBusyCursor ()
voidclearNodeSelectionHolds ()
voidclearUndoStack ()
voidclearViewportRedrawLocks ()
voidconnect ( Object sender, String signal, Object receiver, String function )
voidconnect ( Object sender, String signal, Object thisObject, Function functionRef )
voidconnect ( Object sender, String signal, Function functionRef )
voiddebug ( expression )
voiddisconnect ( Object sender, String signal, Function functionRef )
voiddisconnect ( Object sender, String signal, Object thisObject, Function functionRef )
voiddisconnect ( Object sender, String signal, Object receiver, String function )
voiddropNodeSelectionHold ()
voiddropUndo ()
voiddropViewportRedrawLock ()
voidfinishBackgroundProgress ()
ObjectfinishBackgroundProgressWithDetail ()
voidfinishProgress ()
ObjectfinishProgressWithDetail ()
ArraygetArguments ()
StringgetErrorMessage ( DzError errCode )
QObjectgetObjectParent ( QObject obj )
DzAuthorgetScriptAuthor ()
StringgetScriptFileName ()
StringgetScriptType ()
StringgetScriptVersionString ()
voidinclude ( String scriptPath )
BooleanpointersAreEqual ( QObject ptr1, QObject ptr2 )
voidprocessEvents ()
BooleanprogressIsActive ()
BooleanprogressIsCancelled ()
voidrestoreNodeSelectionHold ()
voidsetBackgroundProgressInfo ( String info )
voidsetBusyCursor ()
voidsetProgressInfo ( String info )
voidsleep ( Number milliseconds )
voidstartBackgroundProgress ( String info, Number totalSteps=0, Boolean isCancellable=false )
voidstartProgress ( String info, Number totalSteps=0, Boolean isCancellable=false, Boolean showTimeElapsed=false )
voidstepBackgroundProgress ( Number numSteps=1 )
voidstepProgress ( Number numSteps=1 )
voidupdateBackgroundProgress ( Number position )
voidupdateProgress ( Number position )
Deprecated
Stringunescape ( String text )
Stringescape ( String text )
BooleanshiftPressed ()
BooleanctrlPressed ()
QDesktopWidget (deprecated)getDesktop ()

Detailed Description

The global object is never used directly, and cannot be created using the new operator. It is automatically created when the scripting engine is initialized, and its functions and properties are available immediately. The global object has no syntax. Its functions and properties are accessed directly.

Properties


Boolean : false

A special value corresponding to the primitive value, false. (Read Only)

Example:

var nTest = 0 > 1;
print( typeof nTest ); // boolean
print( nTest ); // false

Number : Infinity

A special value used to indicate a division by zero occurrence. In Daz Script, division by zero does not raise an error, instead it assigns the Infinity value. Use isFinite() to test if a value is finite or not. (Read Only)

Example:

var nNum = 1/0;
print( typeof nNum ); // number
print( nNum ); // Infinity

JSON : JSON

A global variable that provides script access to the ECMAScript JSON object.


Math : Math

A global variable that provides script access to the ECMAScript Math object.


Number : NaN

A special value used to indicate that the value of a Number, is “Not a Number.” (Read Only)

Example:

var nNum = 1/"six";
print( typeof nNum ); // number
print( nNum ); // NaN

Object : null

A special value used to indicate a variable does not have a value. (Read Only)

Example:

var nNum = null;
print( typeof nNum ); // object
print( nNum ); // null

Boolean : true

A special value corresponding to the primitive value, true. (Read Only)

Example:

var nTest = 0 < 1;
print( typeof nTest ); // boolean
print( nTest ); // true

Undefined : undefined

A special value used to indicate a variable does not have a defined value (e.g., has not yet been assigned). (Read Only)

Example:

var nNum;
print( typeof nNum ); // undefined
print( nNum ); // undefined

DzApp : App

A global variable that provides script access to the application object.


DzColorDialog : ColorDialog

A global variable that provides script access to public static members on QColorDialog.


DzFileDialog : FileDialog

A global variable that provides script access to the file dialog object.


DzGeometryUtil : Geometry

A global variable that provides script access to the geometry object.


DzMainWindow : MainWindow

A global variable that provides script access to the interface object.


DzMessageBox : MessageBox

A global variable that provides script access to public static members on QMessageBox.


DzOpenGL : OpenGL

A global variable that provides script access to the OpenGL object.


DzScene : Scene

A global variable that provides script access to the scene object.


DzSystem : System

A global variable that provides script access to the system object.


DzUndoStack : UndoStack

A global variable that provides script access to the undo stack object.

See Also:

Methods


String : decodeURI( String encodedURI )

Parameter(s):

  • encodedURI - The encoded URI to decode.

Return Value:

  • A new version of encodedURI in which each escape sequence and UTF-8 encoding of the kind that might be introduced by encodeURI() is replaced with the character that it represents. Escape sequences that could not have been introduced by encodeURI() are not replaced.

String : decodeURIComponent( String encodedURIComponent )

Return Value:

  • A new version of encodedURIComponent in which each escape sequence and UTF-8 encoding of the kind that might be introduced by encodeURIComponent() is replaced with the character that it represents.

String : encodeURI( String uri )

Parameter(s):

  • uri - The URI to encode.

Return Value:

  • A new version of uri in which each instance of certain characters is replaced by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.

String : encodeURIComponent( String uriComponent )

Return Value:

  • A new version of uri in which each instance of certain characters is replaced by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.

Object : eval( String str )

Parses and executes str, and returns the result.

Parameter(s):

  • str - The statement to evaluate.

Example:

var sTmp = "x";
var nTmp = 5;
sTmp = eval( "sTmp + nTmp" );
// sTmp: "x5"

Example:

var nTmp = 2;
var nTmp2 = 5;
nTmp = eval( "nTmp + nTmp2" );
// nTmp: 7

Boolean : isFinite( Object expression )

Parameter(s):

  • expression - The script expression to evaluate.

Return Value:

  • false if expression coerces to NaN or Infinity, otherwise true.

Example:

print( "isFinite( NaN ) //", isFinite( NaN ) );
print( "isFinite( undefined ) //", isFinite( undefined ) );
print( "isFinite( {} ) //", isFinite( {} ) );
 
print( "isFinite( true ) //", isFinite( true ), ":", Number( true ) );
print( "isFinite( true ) //", isFinite( false ), ":", Number( false ) );
print( "isFinite( null ) //", isFinite( null ), ":", Number( null ) );
print( "isFinite( 5 ) //", isFinite( 5 ) );
 
print( "isFinite( \"5\" ) //", isFinite( "5" ), ":", Number( "5" ) );
print( "isFinite( \"5.5\" ) //", isFinite( "5.5" ), ":", Number( "5.5" ) );
print( "isFinite( \"5,5\" ) //", isFinite( "5,5" ), ":", Number( "5,5" ) );
print( "isFinite( \"ABC123\" ) //", isFinite( "ABC123" ), ":", Number( "ABC123" ) );
print( "isFinite( \"\" ) //", isFinite( "" ), ":", Number( "" ) );
print( "isFinite( \" \" ) //", isFinite( " " ), ":", Number( " " ) );
 
var dateNow = new Date();
print( "isFinite( new Date() ) //", isFinite( dateNow ), ":", Number( dateNow ) );
var sDate = dateNow.toString();
print( "isFinite( (new Date()).toString() ) //", isFinite( sDate ), ":", Number( sDate ) );

Boolean : isNaN( Object expression )

Parameter(s):

  • expression - The script expression to evaluate.

Return Value:

  • true if expression is NaN (Not a Number), otherwise false.

Example:

print( "isNaN( NaN ) //", isNaN( NaN ) );
print( "isNaN( undefined ) //", isNaN( undefined ) );
print( "isNaN( {} ) //", isNaN( {} ) );
 
print( "isNaN( true ) //", isNaN( true ), ":", Number( true ) );
print( "isNaN( true ) //", isNaN( false ), ":", Number( false ) );
print( "isNaN( null ) //", isNaN( null ), ":", Number( null ) );
print( "isNaN( 5 ) //", isNaN( 5 ) );
 
print( "isNaN( \"5\" ) //", isNaN( "5" ), ":", Number( "5" ) );
print( "isNaN( \"5.5\" ) //", isNaN( "5.5" ), ":", Number( "5.5" ) );
print( "isNaN( \"5,5\" ) //", isNaN( "5,5" ), ":", Number( "5,5" ) );
print( "isNaN( \"ABC123\" ) //", isNaN( "ABC123" ), ":", Number( "ABC123" ) );
print( "isNaN( \"\" ) //", isNaN( "" ), ":", Number( "" ) );
print( "isNaN( \" \" ) //", isNaN( " " ), ":", Number( " " ) );
 
var dateNow = new Date();
print( "isNaN( new Date() ) //", isNaN( dateNow ), ":", Number( dateNow ) );
var sDate = dateNow.toString();
print( "isNaN( (new Date()).toString() ) //", isNaN( sDate ), ":", Number( sDate ) );

Number : parseFloat( String str )

Parses str and returns the floating point number that it represents or NaN if the parse fails. Leading and trailing whitespace is ignored, and if the string contains a number followed by non-numeric characters, the value of the number is returned and the remainder of the string is ignored.

Parameter(s):

  • str - The string to convert to a floating point number.

Return Value:

  • A floating point number or NaN.

Example:

print( "parseFloat( \"5\" ) //", parseFloat( "5" ) );
print( "parseFloat( \"5.5\" ) //", parseFloat( "5.5" ) );
print( "parseFloat( \"5,5\" ) //", parseFloat( "5,5" ) );
print( "parseFloat( \"5ABC\" ) //", parseFloat( "5ABC" ) );
print( "parseFloat( \"ABC5\" ) //", parseFloat( "ABC5" ) );

Number : parseInt( String str, Number radix )

Parses the string and returns the integer that it represents or NaN if the parse fails. Leading and trailing whitespace is ignored, and if the string contains a number followed by non-numeric characters, the value of the number is returned and the remainder of the string is ignored.

Parameter(s):

  • str - The string to convert to an integer.
  • radix - The (optional) base of the number; [2,36]; if not specified, base is determined as follows:
    • base 16 if the number begins with “0x” or “0X”
    • base 8 if the number begins with “0”
    • base 10 otherwise

Return Value:

  • An integer or NaN.

Example:

print( "parseInt( \"5\" ) //", parseInt( "5" ) );
print( "parseInt( \"5.5\" ) //", parseInt( "5.5" ) );
print( "parseInt( \"5,5\" ) //", parseInt( "5,5" ) );
print( "parseInt( \"5ABC\" ) //", parseInt( "5ABC" ) );
print( "parseInt( \"ABC5\" ) //", parseInt( "ABC5" ) );
print( "parseInt( \"0x0123456789abcdef\" ) //", parseInt( "0x0123456789abcdef" ) );
print( "parseInt( \"0123456789abcdef\", 16 ) //", parseInt( "0123456789abcdef", 16 ) );
print( "parseInt( \"01234567\" ) //", parseInt( "01234567" ) );
print( "parseInt( \"01234567\", 8 ) //", parseInt( "01234567", 8 ) );
print( "parseInt( \"10001110101\", 2 ) //", parseInt( "10001110101", 2 ) );

void : gc()

While the garbage collector is automatically run for script objects that are no longer referenced, there is no guarantee on when it will take place. This function can be used to discretely request garbage collection.


void : print( String expression )

Prints the expression to the console (if executed from within the Script IDE pane) or to the log.

Parameter(s):

  • expression - The expression to print - the argument will be converted to a string (via toString) if necessary.

Attention:

  • Multiple expressions can be passed in if each additional expression is separated from the previous with a comma (,). The resulting output will include a single space between the expressions.

Example:

print( "Hello, World!" );

String : qsTr( String sourceText, String disambiguation=“”, Number n=-1 )

Parameter(s):

  • sourceText - The string to lookup a translation for.
  • disambiguation - Additional information, for the translator, to help clarify which usage of sourceText the translation is for.
  • n - Depending on this value, a different translation will be returned with the correct grammatical number for the target language - any occurrence of “%n” in sourceText is replaced with n's value.

Return Value:

  • A translated version of sourceText if a translated version of sourceText is available for the loaded language, otherwise sourceText itself.

Example:

(function(){
 
	var sSource = "Source Text";
	var sComment = "Disambiguation";
	print( qsTr( sSource, sComment, 0 ) );
 
})();

See Also:


String : qsTranslate( String context, String sourceText, String disambiguation=“” )

Parameter(s):

  • context - The context to perform the lookup in.
  • sourceText - The string to perform a translation lookup for.
  • disambiguation - Additional information, intended for someone performing translation, to help clarify which usage of sourceText is meant.

Return Value:

  • A translated version of sourceText if a translated version of sourceText is available for the loaded language, otherwise sourceText itself.

Example:

(function(){
 
	var sContext = "Context";
	var sSource = "Source Text";
	var sComment = "Disambiguation";
	print( qsTranslate( sContext, sSource, sComment ) );
 
})();

See Also:


String : qsTrId( String id, Number n=-1 )

Parameter(s):

  • id - The id of the string to lookup.
  • n - Depending on this value, a different translation will be returned with the correct grammatical number for the target language - any occurrence of “%n” in the text returned for id is replaced with n's value.

Return Value:

  • A translated string identified by id. If no matching string is found, id itself is returned.

Example:

(function(){
 
	print( qsTrId( "Id", 0 ) );
 
})();

See Also:


String : QT_TR_NOOP( String sourceText )

Parameter(s):

  • sourceText - The string to lookup a translation for.

Return Value:

  • A translated version of sourceText if a translated version of sourceText is available for the loaded language, otherwise sourceText itself.

Attention:

  • Use this or QT_TRANSLATE_NOOP() when working with lupdate to allow strings to be extracted from source.

Example:

(function(){
 
	print( QT_TR_NOOP( "Source Text" ) );
 
})();

See Also:


String : QT_TRANSLATE_NOOP( String context, String sourceText )

Parameter(s):

  • context - The context to perform the lookup in.
  • sourceText - The string to perform a translation lookup for.

Return Value:

  • A translated version of sourceText if a translated version of sourceText is available for the loaded language, otherwise sourceText itself.

Attention:

  • Use this or QT_TR_NOOP() when working with lupdate to allow strings to be extracted from source.

Example:

(function(){
 
	print( QT_TRANSLATE_NOOP( "Context", "Source Text" ) );
 
})();

See Also:


void : acceptUndo( String caption )

Accepts and finishes a hold on the undo stack started by calling beginUndo().

Parameter(s):

  • caption - The brief description for the action that will be displayed to the user.

See Also:


Boolean : backgroundProgressIsActive()

Return Value:

  • true if one or more background progress operations are currently being tracked, otherwise false.

See Also:


Boolean : backgroundProgressIsCancelled()

Return Value:

  • true if the user has cancelled the current operation by pressing the 'Cancel' button on the background progress, otherwise false.

void : beginNodeSelectionHold()

Captures the current state of node selection in the scene, on a node selection stack. Match every call to this function with a call to dropNodeSelectionHold() to restore the previous node selection state.

Attention:

  • Since a logic error in a script may result in the node selection stack remaining populated, this function ensures that the node selection stack is cleared at the end of script execution.

See Also:

Since:

  • 4.9.4.109

void : beginUndo()

Starts a hold on the undo stack.

Attention:

  • It is recommended that this function is used instead of accessing DzUndoStack directly, since a logic error in a script may result in the undo stack being left open. Calling this function ensures that the undo stack will be closed at the end of script execution.

void : beginViewportRedrawLock()

Locks redrawing of the viewports - increments the count of viewport redraw locks applied in the context of the current script execution.

After this is called, viewports will not redraw themselves until a matching call to dropViewportRedrawLock() is made or execution of the script has completed, whichever occurs first.

Attention:

  • Since a logic error in a script may result in a viewport redraw lock being left applied, this function ensures that all viewport redraw locks created by this function are cleared at the end of script execution.

See Also:

Since:

  • 4.22.1.88

void : cancelBackgroundProgress()

Cancels the current background progress tracking operation and closes the background progress if no other progress tracking operations are active. If the current operation cannot be cancelled, this has no effect.

Attention:

  • A call to this function does not cause the current background progress tracking operation to be popped off the stack. Follow a call to this function with a call to finishBackgroundProgress() in order to pop the current background progress from the stack.

Since:

  • 4.22.1.110

void : cancelProgress()

Cancels the current script progress tracking operation and closes the progress dialog if no other progress tracking operations are active. If the current operation can not be cancelled, this has no effect.

Attention:

  • A call to this function does not cause the current progress tracking operation to be popped off the stack. Follow a call to this function with a call to finishProgress() in order to pop the current progress from the stack.

Since:

  • 4.22.1.110

void : cancelUndo()

Accepts the hold on the undo stack but immediately calls undo to restore the state of the stack to what it was before the matching beginUndo() call.


void : clearBusyCursor()

Clears the application-standard busy cursor and returns the mouse cursor to the previous cursor. Match every call to setBusyCursor() with a call to this function.

Example:

setBusyCursor();
// ... do something ...
clearBusyCursor();

void : clearNodeSelectionHolds()

Clears all selection holds without restoring the selection.

See Also:

Since:

  • 4.9.4.109

void : clearUndoStack()

Clears the undo stack of all undo/redo items.


void : clearViewportRedrawLocks()

Clears all viewport redraw locks created by the current script execution.

See Also:

Since:

  • 4.22.1.88

void : connect( Object sender, String signal, Object receiver, String function )

Connects a signal from one object to a function (slot) on another object.

Parameter(s):

  • sender - The object emitting the signal.
  • signal - The signal being emitted.
  • receiver - The object that will receive the signal.
  • function - The name of the method on receiver to execute when sender emits signal. If receiver is a script defined Function, the 'this' object within the context of the function will be the Global object.

See Also:


void : connect( Object sender, String signal, Object thisObject, Function functionRef )

Connects a signal from an object to a function.

Parameter(s):

  • sender - The object emitting the signal.
  • signal - The signal being emitted.
  • thisObject - The object to bind to 'this' in the scope of functionRef if functionRef is a script-defined Function. If functionRef is a function on a QObject, this argument is not used.
  • functionRef - The function to execute when sender emits signal.

See Also:

Since:

  • 4.15.0.18

void : connect( Object sender, String signal, Function functionRef )

Connects a signal from an object to a function.

Parameter(s):

  • sender - The object emitting the signal.
  • signal - The signal being emitted.
  • functionRef - The function to execute when sender emits signal.

See Also:


void : debug( expression )

Prints expression to the output console (stderr), followed by a newline.

Example:

debug( "Um... Houston?" );

void : disconnect( Object sender, String signal, Function functionRef )

Disconnects a signal from an object to a function.

Parameter(s):

  • sender - The object emitting the signal.
  • signal - The signal being emitted.
  • functionRef - The function to disconnect from signal.

See Also:


void : disconnect( Object sender, String signal, Object thisObject, Function functionRef )

Disconnects a signal from an object to a function.

Parameter(s):

  • sender - The object emitting the signal.
  • signal - The signal being emitted.
  • thisObject - The object bound to 'this' in the scope of functionRef if functionRef is a script-defined Function. If functionRef is a function on a QObject, this argument is not used.
  • functionRef - The function to disconnect from signal.

See Also:

Since:

  • 4.15.0.18

void : disconnect( Object sender, String signal, Object receiver, String function )

Disconnects a signal from one object to a function (slot) on another object.

Parameter(s):

  • sender - The object emitting the signal.
  • signal - The signal being emitted.
  • receiver - The object that receives the signal.
  • function - The method on receiver to disconnect from signal.

See Also:


void : dropNodeSelectionHold()

Removes the current hold on the state of node selection in the scene without restoring the selection.

See Also:

Since:

  • 4.9.4.109

void : dropUndo()

Accepts the actions performed since calling beginUndo() and removes the current hold on the undo stack without adding the items to the undo stack - the memory associated with the items is freed.


void : dropViewportRedrawLock()

Removes a viewport redraw lock - decrements the count of viewport redraw locks applied in the context of the current script execution.

See Also:

Since:

  • 4.22.1.88

void : finishBackgroundProgress()

Ends the current background progress tracking operation, and closes the background progress if no other background progress tracking operations are active.

See Also:


Object : finishBackgroundProgressWithDetail()

Ends the current background progress tracking operation and closes the background progress if no other background progress tracking operations are active.

Return Value:

  • A map providing information about the background progress tracking operation (if any), otherwise an empty map.

See Also:

Since:

  • 4.22.1.110

void : finishProgress()

Ends the current progress tracking operation, and closes the progress dialog if no other progress tracking operations are active.

See Also:


Object : finishProgressWithDetail()

Ends the current script progress tracking operation and closes the progress dialog if no other progress tracking operations are active.

Return Value:

  • A map providing information about the progress tracking operation (if any), otherwise an empty map.

See Also:

Since:

  • 4.22.1.110

Array : getArguments()

Return Value:

  • The list of arguments passed (if any) to the script upon execution, otherwise an empty list.

See Also:


String : getErrorMessage( DzError errCode )

This function converts an error code into a string message.

Parameter(s):

  • errCode - The error code to convert.

Return Value:

  • A user-readable message that describes the error represented by the error code.

QObject : getObjectParent( QObject obj )

This function allows a script to get the object-parent of a QObject.

Parameter(s):

  • obj - The QObject to get the parent of.

Return Value:


DzAuthor : getScriptAuthor()

Return Value:

  • The author of the current script (if any), otherwise an empty/ invalid author.

String : getScriptFileName()

Return Value:

  • The file name of the current script (if any), otherwise an empty string.

String : getScriptType()

Return Value:

  • The file type that this script was saved out as.

String : getScriptVersionString()

Return Value:

  • The version of the current script (if any), otherwise an empty string.

void : include( String scriptPath )

Includes the contents of scriptPath in the same context as the calling script. This function should only be called within the global scope of the script; it should not be called within a nested scope and it should not be called inline. As a safeguard against circular references, the script engine keeps an internal list of unique paths for included scripts; per script context, per execution. Each time the function is called, scriptPath is checked against the list to ensure that the path has only been included once within the context of the script.

Parameter(s):

  • scriptPath - The path of the script to include. The path is assumed to be relative to the ./scripts directory. Absolute paths are also supported.

Example:

include( "MyFolder/MyScript.dse" );
oMyObject.myFunction();

Boolean : pointersAreEqual( QObject ptr1, QObject ptr2 )

This function allows a script to test if two QObject derived variables point to the same instance.

Parameter(s):

  • ptr1 - The first object.
  • ptr2 - The second object.

Return Value:

  • true if the pointers point to the same object, otherwise false.

void : processEvents()

Pauses execution of the script and allows the main/GUI thread time to process events.


Boolean : progressIsActive()

Return Value:

  • true if one or more progress operations are currently being tracked, otherwise false.

Boolean : progressIsCancelled()

Return Value:

  • true if the user has cancelled the current operation by pressing the 'Cancel' button on the progress dialog, otherwise false.

void : restoreNodeSelectionHold()

Restores node selection in the scene to the state it was in when the last call to beginNodeSelectionHold() was made.

See Also:

Since:

  • 4.9.4.109

void : setBackgroundProgressInfo( String info )

Sets the string to display in the status bar.

Parameter(s):

  • info - The string to display in the status bar as the current description of the operation.

See Also:

Since:

  • 4.22.1.110

void : setBusyCursor()

Sets the application-standard busy cursor - increments the count of busy cursors set in the context of the current script execution. Match every call to this function with a call to clearBusyCursor() to restore the previous cursor.

Attention:

  • Since a logic error in a script may result in a busy cursor being left applied, this function ensures that all busy cursors applied by this function are cleared at the end of script execution.

Example:

setBusyCursor();
// ... do something ...
clearBusyCursor();

void : setProgressInfo( String info )

Sets the string to display in the progress dialog.

Parameter(s):

  • info - The string to display in the progress dialog as the current description of the operation.

Since:

  • 4.22.1.110

void : sleep( Number milliseconds )

Pauses the script for the specified number of milliseconds without blocking the application event loop.

Parameter(s):

  • milliseconds - The duration, in milliseconds, to sleep.

Example:

print( new Date );
sleep( 6000 ); // 0.1 min
print( new Date );

Since:

  • 4.8.0.45

void : startBackgroundProgress( String info, Number totalSteps=0, Boolean isCancellable=false )

Displays a background progress bar to the user if one is not already being displayed and starts a progress tracking operation.

Parameter(s):

  • info - The string to display in the status bar as the current description of the operation.
  • totalSteps - The number of progress steps for the operation to be complete.
  • isCancellable - If true, the user is given the option to cancel the operation.

See Also:


void : startProgress( String info, Number totalSteps=0, Boolean isCancellable=false, Boolean showTimeElapsed=false )

Displays a progress dialog to the user if one is not already being displayed and starts a progress tracking operation.

Parameter(s):

  • info - The string to display in the progress dialog as the current description of the operation.
  • totalSteps - The number of progress steps for the operation to be complete.
  • isCancellable - If true, the user is given the option to cancel the operation.
  • showTimeElapsed - If true, the amount of time since the progress operation was started will be displayed in the dialog.

See Also:


void : stepBackgroundProgress( Number numSteps=1 )

Steps the current background progress forward the specified number of steps.

Parameter(s):

  • numSteps - The number of steps to move the progress indicator forward.

void : stepProgress( Number numSteps=1 )

Steps the current progress dialog forward the specified number of steps.

Parameter(s):

  • numSteps - The number of steps to move the progress indicator forward.

See Also:


void : updateBackgroundProgress( Number position )

Sets the current background progress to the specified number of steps.

Parameter(s):

  • position - The number of steps to set as the current position for the progress indicator.

See Also:


void : updateProgress( Number position )

Sets the current progress dialog to the specified number of steps.

Parameter(s):

  • position - The number of steps to set as the current position for the progress indicator.

String : unescape( String text )

Deprecated

Exists only to keep old code working. Do not use in new code. Use decodeURI() or decodeURIComponent() instead.


String : escape( String text )

Deprecated

Exists only to keep old code working. Do not use in new code. Use encodeURI() or encodeURIComponent() instead.


Boolean : shiftPressed()

Deprecated

Exists only to keep old code working. Do not use in new code. Use DzApp::modifierKeyState() instead.

var bShiftPressed = App.modifierKeyState() & 0x02000000;

Boolean : ctrlPressed()

Deprecated

Exists only to keep old code working. Do not use in new code. Use DzApp::modifierKeyState() instead.

var bControlPressed = App.modifierKeyState() & 0x04000000;

QDesktopWidget (deprecated) : getDesktop()

Deprecated

Exists only to keep old code working. Do not use in new code. Use DzDesktopWidget instead.

var wDesktop = new DzDesktopWidget();