System object
system
The System object provides access to attributes found on the user’s system, such as the user name and the name
and version of the operating system. It is available through the system global variable.
Example
alert ("Your OS is " + system.osName + " running version " + system.osVersion);
confirm("You are: " + system.userName + " running on " + system.machineName + ".");
Attributes
Methods
callSystem() method
system.callSystem (cmdLineToExecute);
Executes a system command, as if you had typed it on the operating system’s command line. Returns whatever
the system outputs in response to the command, if anything.
In Windows, you can invoke commands using the /c switch for the cmd.exe command, passing the command
to run in escaped quotes (\"...\"). For example, the following retrieves the current time and displays it to the
user:
var timeStr = system.callSystem("cmd.exe /c \"time /t\"");
alert("Current time is " + timeStr);
Parameters
Returns: The output from the command.
Attribute Reference Description
userName “System userName attribute” on page 181 The current user name.
machineName “System machineName attribute” on page 181 The name of the host computer.
osName “System osName attribute” on page 181 The name of the operating system.
osVersion “System osVersion attribute” on page 181 The version of the operating system.
Method Reference Description
callSystem() “System callSystem() method” on page 180 Execute’s a command on the system’s command line.
cmdLineToExecute A string containing the command and its parameters.
machineName attribute
system.machineName
The name of the computer on which After Effects is running.
Type: String read-only
osName attribute
system.osName
The name of the operating system on which After Effects is running.
NOTE: As of Windows 7, this attribute returns a blank value. Use $.os instead.
Type: String; read-only
osVersion attribute
system.osVersion
The version of the current local operating system.
Type: String; read-only
userName attribute
system.userName
The name of the user currently logged on to the system.
Type: String; read-only