User Tools

Site Tools


DzSystem

A global static object for system services.

More...

Inherits :

Methods

DAZ Script
Stringgetenv ( String environmentVariable )
voidprint ( String expression )
voidprintln ( String expression )
voidsetenv ( String environmentVariable, String value )

Detailed Description

This object provides functions to access and manipulate environment variables. It is accessible via the Global::System variable.

Methods


String : getenv( String environmentVariable )

Parameter(s):

  • environmentVariable - The name of the environment variable to retrieve. The 'environment' only exists within the context of the script process, for the duration of said process.

Return Value:

  • The String stored in environmentVariable.

Example:

var sEnv = System.getenv( "DAZSTUDIO" );
print( sEnv ); //C:/Program Files/DAZ/Studio

void : print( String expression )

Deprecated

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


void : println( String expression )

Deprecated

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


void : setenv( String environmentVariable, String value )

Sets the value of an environment variable. If the environment variable does not exist, it is created. The environment is only changed within the context of the script process, for the duration of said process.

Parameter(s):

  • environmentVariable - The environment variable to set the value of.
  • value - The new value of the environment variable.

Example:

System.setenv( "DAZSTUDIO", App.getHomePath() );
var sEnv = System.getenv( "DAZSTUDIO" );
print( sEnv ); // C:/Program Files/DAZ/Studio