Table of Contents

System

This object allows you to get informations about the current operating system and execute some actions on it.

Functions

System

Constructor function.

Syntax

var myObject = new System();

Methods

storageLocationPath

Returns the path of a standard storage location.

Syntax

myObject.storageLocationPath(location);

Arguments

  1. location - (StorageLocation) the storage location

Returns

storageLocationName

Returns the name of a standard storage location.

Syntax

myObject.storageLocationName(location);

Arguments

  1. location - (StorageLocation) the storage location

Returns

openUrl

Uses the default browser to open an URL.

Syntax

myObject.openUrl(url);

Arguments

  1. url - (string) the URL to open

Returns

Exceptions

screenCount

Returns the screen count.

Syntax

myObject.screenCount();

Returns

availableGeometry

Returns the available geometry on a screen.

Syntax

myObject.screenCount();
myObject.screenCount(screen);

Arguments

  1. screen - (integer) the screen (default: the default screen)

Returns

screenGeometry

Returns the screen geometry.

Syntax

myObject.screenGeometry();
myObject.screenGeometry(screen);

Arguments

  1. screen - (integer) the screen (default: the default screen)

Returns

primaryScreen

Returns the primary screen index.

Syntax

myObject.primaryScreen();

Returns

isVirtualDesktop

Returns true if the desktop is virtual. A virtual desktop may assemble multiple monitors into one screen.

Syntax

myObject.isVirtualDesktop();

Returns

colorDepth

Returns the color depth of a screen.

Syntax

myObject.colorDepth(screen);

Arguments

  1. screen - (integer) the screen (default: the default screen)

Returns

displayBrightness

Returns the display brightness of a screen.

Syntax

myObject.displayBrightness(screen);

Arguments

  1. screen - (integer) the screen (default: the default screen)

Returns

currentDirectory

Returns the current directory.

Syntax

myObject.currentDirectory();

Returns

username

Returns the user name.

Syntax

myObject.username();

Returns

variable

Returns the value of an environment variable.

Syntax

myObject.variable(name);

Arguments

  1. name - (string) the name of the environment variable

Returns

timestamp

Returns the current Unix timestamp.

Syntax

myObject.timestamp();

Returns

osName

Returns the operating system name.

Syntax

myObject.osName();

Returns

Notes

This method should return "GNU/Linux" or "Windows".

version

Returns the operating system version.

Syntax

myObject.version();

Returns

countryCode

Returns the current country code.

Syntax

myObject.countryCode();

Returns

language

Returns the current language.

Syntax

myObject.language();

Returns

logicalDrives

Returns an array of string representing the logical drives.

Syntax

myObject.logicalDrives();

Returns

availableDiskSpace

Returns the available disk space on a drive in bytes.

Syntax

myObject.availableDiskSpace(drive);

Arguments

  1. drive - (string) the drive

Returns

totalDiskSpace

Returns the total disk space on a drive in bytes.

Syntax

myObject.totalDiskSpace(drive);

Arguments

  1. drive - (string) the drive

Returns

driveType

Returns the type of a drive.

Syntax

myObject.driveType(drive);

Arguments

  1. drive - (string) the drive

Returns

batteryLevel

Returns the battery level.

Syntax

myObject.batteryLevel();

Returns

powerState

Returns the power state.

Syntax

myObject.powerState();

Returns

manufacturer

Returns the device's manufacturer name.

Syntax

myObject.manufacturer();

Returns

model

Returns the device's model name.

Syntax

myObject.model();

Returns

productName

Returns the device's product name.

Syntax

myObject.productName();

Returns

logout

Logouts the current user.

Syntax

myObject.logout();
myObject.logout(force);

Arguments

  1. force - (boolean) force the logout

Returns

Exceptions

restart

Restarts the computer.

Syntax

myObject.restart();
myObject.restart(force);

Arguments

  1. force - (boolean) force the restart

Returns

Exceptions

shutdown

Stops the computer.

Syntax

myObject.shutdown();
myObject.shutdown(force);

Arguments

  1. force - (boolean) force the shutdown

Returns

Exceptions

suspend

Suspends the computer.

Syntax

myObject.suspend();
myObject.suspend(force);

Arguments

  1. force - (boolean) force the suspend

Returns

Exceptions

hibernate

Hibernates the computer.

Syntax

myObject.hibernate();
myObject.hibernate(force);

Arguments

  1. force - (boolean) force the hibernation

Returns

Exceptions

lockScreen

Locks the screen.

Syntax

myObject.lockScreen();

Returns

Exceptions

startScreenSaver

Starts the screen saver.

Syntax

myObject.startScreenSaver();

Returns

Exceptions

Enumerations

DriveType

A drive type.

Values

  1. UnknownDrive: an unknown drive
  2. InternalDrive: an internal drive
  3. RemovableDrive: a removable drive
  4. RemoteDrive: a remote drive
  5. CdromDrive: a cdrom drive

PowerState

A power state.

Values

  1. UnknownState: unknown state
  2. BatteryPower: on battery power
  3. WallPower: on wall power
  4. WallPowerChargingBattery: on wall power, charging the battery

StorageLocation

A standard storage location.

Values

  1. Desktop: the desktop
  2. Documents: the documents folder
  3. Fonts: the fonts folder
  4. Applications: the applications folder
  5. Music: the music folder
  6. Movies: the movies folder
  7. Pictures: the pictures folder
  8. Temp: the temporary files folder
  9. Home: the home folder
  10. Data: the data folder
  11. Cache: the cache folder