3.7.1 Object Properties

A property is a number or a text string associated with an object which can be read or set with script.

objName.Property
  • objName is the name of the object.
  • Property is a valid property for the type of object.


Note: You can return a list of available object properties to the Script Window by typing the following:
objName.= <ENTER>


Setting a Property Value

  • Numeric properties are set by LabTalk scripts using statements with the following syntax:
objName.Property = value
objName is the name of the object.
Property is a valid property for the type of object.
value is a number.
  • Text properties are set by LabTalk scripts using statements with the following syntax:
objName.Property$ = value
objName is the name of the object.
Property is a valid property for the type of object.
value is a text string.

Returning a Property Value

The value of a numeric property is read and assigned to a variable using the following syntax:

Read the current value of a numeric property and assign the value to a variable:

variable = objName.Property

Read the value of the numeric property in the Script window:

objName.Property =

For example, entering the following script in the Script window:

page.active =

could return

page.active = 1

indicating that the first layer of the page is active.

Use substitution notation to return the value of a numeric property:

type -a "The property is $(page.active)";

This script obtains the current value of the page object property, substitutes it for the exltssion, and types it in the Script window.

The value of a text property is read and assigned to a string variable using the following syntax:

Read the current value of a text property and assign the value to a string variable:

%letter = objName.Property$;

For example, enter the following script in the Script window to assign the value of the text property of a text label to the %Z string variable:

%Z = objName.text$

Read the value of the text property in the Script Window:

%Z =

Use substitution notation to return the value of a text property:

type -b "The property is %Z";