code:system:system
Differences
This shows you the differences between two versions of the page.
code:system:system [2011/01/30 21:39] – created jmgr | code:system:system [2011/04/20 20:28] (current) – removed jmgr | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== System ====== | ||
- | This object allows you to get informations about the current operating system and execute some actions on it. | ||
- | ===== Functions ===== | ||
- | |||
- | ==== System ==== | ||
- | Constructor function. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | var myObject = new System(); | ||
- | </ | ||
- | |||
- | ===== Methods ===== | ||
- | |||
- | ==== storageLocationPath ==== | ||
- | Returns the path of a standard storage location. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.storageLocationPath(location); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - location - ([[# | ||
- | |||
- | === Returns === | ||
- | * (string) the storage location path | ||
- | |||
- | ==== storageLocationName ==== | ||
- | Returns the name of a standard storage location. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.storageLocationName(location); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - location - ([[# | ||
- | |||
- | === Returns === | ||
- | * (string) the storage location name | ||
- | |||
- | ==== openUrl ==== | ||
- | Uses the default browser to open an URL. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.openUrl(url); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - url - (string) the URL to open | ||
- | |||
- | === Returns === | ||
- | * (System) this System | ||
- | |||
- | === Exceptions === | ||
- | * (OpenUrlError) cannot open the URL | ||
- | |||
- | ==== screenCount ==== | ||
- | Returns the screen count. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.screenCount(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (integer) the screen count | ||
- | |||
- | ==== availableGeometry ==== | ||
- | Returns the available geometry on a screen. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.screenCount(); | ||
- | </ | ||
- | <code javascript> | ||
- | myObject.screenCount(screen); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - screen - (integer) the screen (default: the default screen) | ||
- | |||
- | === Returns === | ||
- | * ([[code: | ||
- | |||
- | ==== screenGeometry ==== | ||
- | Returns the screen geometry. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.screenGeometry(); | ||
- | </ | ||
- | <code javascript> | ||
- | myObject.screenGeometry(screen); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - screen - (integer) the screen (default: the default screen) | ||
- | |||
- | === Returns === | ||
- | * ([[code: | ||
- | |||
- | ==== primaryScreen ==== | ||
- | Returns the primary screen index. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.primaryScreen(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (integer) the primary screen index | ||
- | |||
- | ==== isVirtualDesktop ==== | ||
- | Returns true if the desktop is virtual. A virtual desktop may assemble multiple monitors into one screen. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.isVirtualDesktop(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (boolean) true if the desktop is virtual | ||
- | |||
- | ==== colorDepth ==== | ||
- | Returns the color depth of a screen. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.colorDepth(screen); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - screen - (integer) the screen (default: the default screen) | ||
- | |||
- | === Returns === | ||
- | * (integer) the color depth | ||
- | |||
- | ==== displayBrightness ==== | ||
- | Returns the display brightness of a screen. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.displayBrightness(screen); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - screen - (integer) the screen (default: the default screen) | ||
- | |||
- | === Returns === | ||
- | * (integer) the display brightness | ||
- | |||
- | ==== currentDirectory ==== | ||
- | Returns the current directory. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.currentDirectory(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (string) the current directory | ||
- | |||
- | ==== username ==== | ||
- | Returns the user name. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.username(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (string) the user name | ||
- | |||
- | ==== variable ==== | ||
- | Returns the value of an environment variable. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.variable(name); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - name - (string) the name of the environment variable | ||
- | |||
- | === Returns === | ||
- | * (string) the value of the environment variable | ||
- | |||
- | ==== timestamp ==== | ||
- | Returns the current Unix timestamp. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.timestamp(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (integer) the current Unix timestamp | ||
- | |||
- | ==== osName ==== | ||
- | Returns the operating system name. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.osName(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (string) the operating system name | ||
- | |||
- | === Notes === | ||
- | This method should return " | ||
- | |||
- | ==== version ==== | ||
- | Returns the operating system version. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.version(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (string) the operating system version | ||
- | |||
- | ==== countryCode ==== | ||
- | Returns the current country code. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.countryCode(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (string) the current country code | ||
- | |||
- | ==== language ==== | ||
- | Returns the current language. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.language(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (string) the current language | ||
- | |||
- | ==== logicalDrives ==== | ||
- | Returns an array of string representing the logical drives. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.logicalDrives(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (array) an array of string representing the logical drives | ||
- | |||
- | ==== availableDiskSpace ==== | ||
- | Returns the available disk space on a drive in bytes. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.availableDiskSpace(drive); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - drive - (string) the drive | ||
- | |||
- | === Returns === | ||
- | * (integer) the available disk space on a drive in bytes | ||
- | |||
- | ==== totalDiskSpace ==== | ||
- | Returns the total disk space on a drive in bytes. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.totalDiskSpace(drive); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - drive - (string) the drive | ||
- | |||
- | === Returns === | ||
- | * (integer) the total disk space on a drive in bytes | ||
- | |||
- | ==== driveType ==== | ||
- | Returns the type of a drive. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.driveType(drive); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - drive - (string) the drive | ||
- | |||
- | === Returns === | ||
- | * ([[# | ||
- | |||
- | ==== batteryLevel ==== | ||
- | Returns the battery level. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.batteryLevel(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (integer) the battery level (percentage) | ||
- | |||
- | ==== powerState ==== | ||
- | Returns the power state. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.powerState(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * ([[# | ||
- | |||
- | ==== manufacturer ==== | ||
- | Returns the device' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.manufacturer(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (string) the manufacturer name | ||
- | |||
- | ==== model ==== | ||
- | Returns the device' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.model(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (string) the model name | ||
- | |||
- | ==== productName ==== | ||
- | Returns the device' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.productName(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (string) the product name | ||
- | |||
- | ==== logout ==== | ||
- | Logouts the current user. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.logout(); | ||
- | </ | ||
- | <code javascript> | ||
- | myObject.logout(force); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - force - (boolean) force the logout | ||
- | |||
- | === Returns === | ||
- | * (System) this System | ||
- | |||
- | === Exceptions === | ||
- | * (LogoutError) unable to logout | ||
- | |||
- | ==== restart ==== | ||
- | Restarts the computer. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.restart(); | ||
- | </ | ||
- | <code javascript> | ||
- | myObject.restart(force); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - force - (boolean) force the restart | ||
- | |||
- | === Returns === | ||
- | * (System) this System | ||
- | |||
- | === Exceptions === | ||
- | * (RestartError) unable to restart | ||
- | |||
- | ==== shutdown ==== | ||
- | Stops the computer. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.shutdown(); | ||
- | </ | ||
- | <code javascript> | ||
- | myObject.shutdown(force); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - force - (boolean) force the shutdown | ||
- | |||
- | === Returns === | ||
- | * (System) this System | ||
- | |||
- | === Exceptions === | ||
- | * (ShutdownError) unable to shutdown | ||
- | |||
- | ==== suspend ==== | ||
- | Suspends the computer. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.suspend(); | ||
- | </ | ||
- | <code javascript> | ||
- | myObject.suspend(force); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - force - (boolean) force the suspend | ||
- | |||
- | === Returns === | ||
- | * (System) this System | ||
- | |||
- | === Exceptions === | ||
- | * (SuspendError) unable to suspend | ||
- | |||
- | ==== hibernate ==== | ||
- | Hibernates the computer. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.hibernate(); | ||
- | </ | ||
- | <code javascript> | ||
- | myObject.hibernate(force); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - force - (boolean) force the hibernation | ||
- | |||
- | === Returns === | ||
- | * (System) this System | ||
- | |||
- | === Exceptions === | ||
- | * (HibernateError) unable to hibernate | ||
- | |||
- | ==== lockScreen ==== | ||
- | Locks the screen. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.lockScreen(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (System) this System | ||
- | |||
- | === Exceptions === | ||
- | * (LockScreenError) unable to lock the screen | ||
- | |||
- | ==== startScreenSaver ==== | ||
- | Starts the screen saver. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.startScreenSaver(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (System) this System | ||
- | |||
- | === Exceptions === | ||
- | * (StartScreenSaverError) unable to start the screen saver | ||
- | |||
- | ===== Enumerations ===== | ||
- | |||
- | ==== DriveType ==== | ||
- | A drive type. | ||
- | |||
- | === Values === | ||
- | - UnknownDrive: | ||
- | - InternalDrive: | ||
- | - RemovableDrive: | ||
- | - RemoteDrive: | ||
- | - CdromDrive: a cdrom drive | ||
- | |||
- | ==== PowerState ==== | ||
- | A power state. | ||
- | |||
- | === Values === | ||
- | - UnknownState: | ||
- | - BatteryPower: | ||
- | - WallPower: on wall power | ||
- | - WallPowerChargingBattery: | ||
- | |||
- | ==== StorageLocation ==== | ||
- | A standard storage location. | ||
- | |||
- | === Values === | ||
- | - Desktop: the desktop | ||
- | - Documents: the documents folder | ||
- | - Fonts: the fonts folder | ||
- | - Applications: | ||
- | - Music: the music folder | ||
- | - Movies: the movies folder | ||
- | - Pictures: the pictures folder | ||
- | - Temp: the temporary files folder | ||
- | - Home: the home folder | ||
- | - Data: the data folder | ||
- | - Cache: the cache folder |
code/system/system.1296423544.txt.gz · Last modified: 2021/02/13 11:23 (external edit)