Local and Global Properties for Chunk Expressions
Chunk expressions provide a powerful way of handling text data in SenseTalk scripts. The local and global properties described here let you control how chunks are accessed. For additional information about using chunks in SenseTalk, see Chunk Expressions.
Setting or Changing Local and Global Property Values:
You can set a global property value with the SenseTalk commands Set or Put. Note that when you reference one of these properties, you must use the word the before the property name to distinguish it from an ordinary variable.
Examples:
set the searchrectangle to [1,2,2,3]
put 2 into the remoteworkinterval
You can add or change specific named properties within a global property like this:
set the namedColors.pink to color("RGB,1.0,0.5,0.5") -- Adds pink to the namedColors global property and defines its RGB color value
set the listFormat's separator to " & " -- Sets the separator property of the listFormat global property
Properties can also be set or updated by using the setoption or setoptions commands. The setoption command lets you update a single property, and setoptions lets you update multiple properties.
Examples:
setoption searchrectangle, [1,2,2,3]
setoptions {searchrectangle: [1,2,2,3], scriptlogging: yes}
Because setoption and setoptions are specific for use with global and local properties, you omit the word the from the property name in the command syntax for these commands.
For additional information about working with local and global properties, see Local and Global Properties in SenseTalk.
the wordDelimiter Local Property, the defaultWordDelimiter Global Property
,
Values: Any character or list of characters, which will serve as separators between words in a container
Default:
- For
the wordDelimiter: The current value ofthe defaultWordDelimiterglobal property - For
the defaultWordDelimiter: Space, Tab, and Return
Behavior: These properties specify the set of characters recognized as separators between words in a container. Any sequence of these characters, in any order or combination, can appear between words.
the wordDelimiter property is local to each handler. Setting its value in one handler doesn't affect its value in other handlers called from that handler, or vice versa. When each handler begins running, the wordDelimiter in that handler is initially set to the value of the defaultWordDelimiter global property.
Example:
set the wordDelimiter to "." // Changes the local word delimiter to period