Accessing System Information with SenseTalk

These functions provide information about various aspects of the system where the SenseTalk script is running.

<<<<<<< HEAD

diskSpace function

=======

diskSpace function

What It Does

Returns the number of bytes of free space available on a disk. If fileOrFolder is not specified, the diskSpace() function returns the amount of space available on the volume containing the current working folder, as indicated by the folder global property.

When to Use It >>>>>>> el_redesign_integration

Behavior: Returns the number of bytes of free space available on a disk.

Use the diskSpace() function to find out how much free space (in bytes) is available on a file system.

Parameters: The name of an existing file or folder. Optional.

If the diskSpace() function is called without any parameter, it returns the amount of free space in bytes in the file system containing the current working folder. If a parameter is given, it should be the name of an existing file or folder, and diskSpace() will return the amount of free space on the file system containing that file or folder.

<<<<<<< HEAD
Note: If fileOrFolder is not specified, the diskSpace() function returns the amount of space available on the volume containing the current working folder, as indicated by the folder global property.

Syntax: =======

Syntax

the diskSpace {of fileOrFolder} diskSpace(fileOrFolder)

diskSpace(fileOrFolder)

Example

put diskSpace() into spaceRemaining

if diskspace is less than a Megabyte then

put "You have less than a megabyte of space remaining!"

end if

Example

if diskSpace("/Volumes/sparky") is less than 1000 then

put "Less than a thousand bytes left on /Volumes/sparky!!"

end if

EggPlantVersion Function

Example: >>>>>>> el_redesign_integration

the diskSpace [{of fileOrFolder}|(fileOrFolder)]

diskSpace (fileOrFolder)

Example:

put diskSpace() into spaceRemaining

if diskspace is less than a Megabyte then

put "You have less than a megabyte of space remaining!"

end if

if diskSpace("/Volumes/sparky") is less than 1000 then

put "Less than a thousand bytes left on /Volumes/sparky!!"

end if

EggPlantVersion Function

Behavior: Returns the number of your version of .

Parameters: None.

<<<<<<< HEAD Returns: The number of your version of . For example: Eggplant 19.2.1-Windows

Example:

log the eggPlantVersion

env function

Behavior: The env function provides access to the environment variables supplied by the environment in which SenseTalk is running.

Parameters: One environment variable. Optional.

Call env() with 1 parameter that is the name of a particular environment variable to retrieve the value of that variable. Call env() with no parameters to get a property list containing all of the environment variables.

Syntax:

the env {of varName}

env (varName)

Examples:

put env("Home") into homeFolder

put env() -- display all available information

hostAddresses function

Behavior: The hostAddresses function returns a list of all of the IP addresses for the host computer where SenseTalk is running.

Call hostAddresses to find all of the network IP addresses for the local host.

Parameters: None.

Examples:

put item 1 of the hostAddresses into myIPAddress

Syntax:

the hostAddresses

hostAddresses()

hostName, hostNames functions

Behavior: The hostName function returns the standard host name of the machine on which the script is running. The hostNames function returns a list of all of the known host names.

Call hostName or hostNames to find names by which the local host may be known on the network.

Parameters: None.

Examples:

put the hostName into localName

Syntax:

the hostName

hostName()

the hostNames

hostNames()

machine function

Behavior: Returns the type of machine hardware of the computer where SenseTalk is running.

Call machine to determine the machine hardware platform.

Parameters: None.

Examples:

if the machine is "i386" then put "Intel" into hardwareType

Syntax:

the machine

machine()

OSInfo function

Behavior: The OSInfo function returns a property list containing various items of information about the operating system of the machine where SenseTalk is running.

Call OSInfo to learn information about the host operating system.

Parameters: None.

Examples:

put the OSInfo

Syntax:

the OSInfo

OSInfo()

platform function

Behavior: The platform function returns the name of the host operating system where SenseTalk is running, such as "MacOS", "Linux", etc.

Call platform to make decisions based on SenseTalk's host platform.

Parameters: None.

Examples:

if the platform is "MacOS" then exit script

Syntax:

the platform

platform()

processInfo function

Behavior: The processInfo function returns a property list containing information about the process within which the script is running, including its name, parameters, and process id.

Call processInfo to obtain information about the identity of the process running the script.

Parameters: None.

Examples:

put the processInfo

Syntax:

the processInfo

processInfo()

processor function

Behavior: The processor function returns the type of processor of the host computer where SenseTalk is running, such as "x86", "Power Macintosh", etc.

Call processor to determine the CPU type for the local host.

Parameters: None.

Examples:

put the processor into CPUType

Syntax:

the processor

processor()

systemInfo function

Behavior: The systemInfo function returns a property list containing various pieces of information about the system where SenseTalk is running.

Call systemInfo to learn information such as the amount of memory installed or the processor byte order for the local host.

Parameters: None.

Examples:

put the systeminfo's memorySize /1 GB into gigaBytes

if systemInfo().NativeByteOrder is "Big-Endian" then swap

Syntax:

the systemInfo

systemInfo()

systemVersion function

Behavior: The systemVersion function returns the version number of the system where is running.

Use systemVersion to check which OS version a script is running on.

Parameters: None.

Examples:

if systemVersion() begins with "10.5" then put "Leopard!"

Syntax:

the systemVersion

systemVersion()

userInfo function

Behavior: The userInfo function returns a property list containing various pieces of information about the user account where SenseTalk is running.

Call userInfo to get information about the logged-in user, such as their FullName, ShortName, and HomeDirectory.

Parameters: None.

Examples:

put the userInfo's FullName into fullName

set the folder to userInfo().HomeDirectory

Syntax:

the userInfo

userInfo()

version, long version, senseTalkVersion, buildNumber functions

Behavior: These functions provide the current version number of the application (a number), a long form of the version (a string containing more information), the version of the SenseTalk engine being used (a number), and the current build number (a whole number) respectively.

Use these functions to identify what version of an application or of SenseTalk is in use. This might be useful, for example, to determine if a specific feature is available and avoid using it otherwise.

Parameters: None.

Examples:

if version() >= 2.0 then useAdvancedFeatures

put the long version

if the senseTalkVersion < requiredVersion then exit all

put buildNumber() into latestBuildUsed

Syntax:

the {long} version

version()

the senseTalkVersion

senseTalkVersion()

the buildNumber

buildNumber()

======= Returns: The number of your version of . For example: Eggplant 16.1.2-Windows

Behavior: Returns the number of your version of .

env function

What it Does

The env function provides access to the environment variables supplied by the environment in which SenseTalk is running.

When to Use It

Call env() with 1 parameter that is the name of a particular environment variable to retrieve the value of that variable. Call env() with no parameters to get a property list containing all of the environment variables.

Example

put env("Home") into homeFolder

Example

put env() -- display all available information

Syntax

the env {of varName}

env(varName)

hostAddresses function

What it Does

The hostAddresses function returns a list of all of the IP addresses for the host computer where SenseTalk is running.

When to Use It

Call hostAddresses to find all of the network IP addresses for the local host.

Example

put item 1 of the hostAddresses into myIPAddress

Syntax

the hostAddresses

hostAddresses()

hostName, hostNames functions

What it Does

The hostName function returns the standard host name of the machine on which the script is running. The hostNames function returns a list of all of the known host names.

When to Use It

Call hostName or hostNames to find names by which the local host may be known on the network.

Example

put the hostName into localName

Syntax

the hostName

hostName()

the hostNames

hostNames()

machine function

What it Does

Returns the type of machine hardware of the computer where SenseTalk is running.

When to Use It

Call machine to determine the machine hardware platform.

Example

if the machine is "i386" then put "Intel" into hardwareType

Syntax

the machine

machine()

OSInfo function

What it Does

The OSInfo function returns a property list containing various items of information about the operating system of the machine where SenseTalk is running.

When to Use It

Call OSInfo to learn information about the host operating system.

Example

put the OSInfo

Syntax

the OSInfo

OSInfo()

platform function

What it Does

The platform function returns the name of the host operating system where SenseTalk is running, such as "MacOS", "Linux", etc.

When to Use It

Call platform to make decisions based on SenseTalk's host platform.

Example

if the platform is "MacOS" then exit script

Syntax

the platform

platform()

processInfo function

What it Does

The processInfo function returns a property list containing information about the process within which the script is running, including its name, parameters, and process id.

When to Use It

Call processInfo to obtain information about the identity of the process running the script.

Example

put the processInfo

Syntax

the processInfo

processInfo()

processor function

What it Does

The processor function returns the type of processor of the host computer where SenseTalk is running, such as "x86", "Power Macintosh", etc.

When to Use It

Call processor to determine the CPU type for the local host.

Example

put the processor into CPUType

Syntax

the processor

processor()

systemInfo function

What it Does

The systemInfo function returns a property list containing various pieces of information about the system where SenseTalk is running.

When to Use It

Call systemInfo to learn information such as the amount of memory installed or the processor byte order for the local host.

Example

put the systeminfo's memorySize /1 GB into gigaBytes

Example

if systemInfo().NativeByteOrder is "Big-Endian" then swap

Syntax

the systemInfo

systemInfo()

systemVersion function

What it Does

The systemVersion function returns the version number of the operating system on the host computer where SenseTalk is running.

When to Use It

Use systemVersion to check which OS version a script is running on.

Example

if systemVersion() begins with "10.5" then put "Leopard!"

Syntax

the systemVersion

systemVersion()

userInfo function

What it Does

The userInfo function returns a property list containing various pieces of information about the user account where SenseTalk is running.

When to Use It

Call userInfo to get information about the logged-in user, such as their FullName, ShortName, and HomeDirectory.

Example

put the userInfo's FullName into fullName

Example

set the folder to userInfo().HomeDirectory

Syntax

the userInfo

userInfo()

version, long version, senseTalkVersion, buildNumber functions

What it Does

These functions provide the current version number of the application (a number), a long form of the version (a string containing more information), the version of the SenseTalk engine being used (a number), and the current build number (a whole number) respectively.

When to Use It

Use these functions to identify what version of an application or of SenseTalk is in use. This might be useful, for example, to determine if a specific feature is available and avoid using it otherwise.

Example

if version() >= 2.0

then useAdvancedFeatures

put the long version

if the senseTalkVersion < requiredVersion then exit all

put buildNumber() into latestBuildUsed

Syntax

the {long} version

version()

the senseTalkVersion

senseTalkVersion()

the buildNumber

buildNumber()

>>>>>>> el_redesign_integration