User Tools

Site Tools


dictionary:unitinformation:enumeratedvalue

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
dictionary:unitinformation:enumeratedvalue [2023/05/20 14:47] – added optional for parameter James Sentmandictionary:unitinformation:enumeratedvalue [2023/05/20 15:14] (current) James Sentman
Line 1: Line 1:
 =====Enumerated Value Of===== =====Enumerated Value Of=====
  
-**Enumerated Value Of “Name of Unit” (optionalfor (integer value to get enumeration for)**\\+**Enumerated Value (optional: Of “Name of Unit”(optionalfor (integer value to get enumeration for))**\\
 returns string, or script error if value is out of range for available enumerations returns string, or script error if value is out of range for available enumerations
  
  
-The **Enumerated Value Of** verb returns a string equal to the enumerated value of a unit if available and in range or an apple script error if it is not. Examples of units that could be enumerated might be a thermostat mode unit which could be “off, heat, cool, auto,” a garage door unit that could be “open, closed” or a ceiling fan that might be “off, low, medium, medium-high, high"+The **Enumerated Value Of** verb returns a string equal to the enumerated value of a unit if available and in range or an apple script error if it is not. Examples of units that could be enumerated might be a thermostat mode unit which could be “off, heat, cool, auto,” a garage door unit that could be “open, closed” or a ceiling fan that might be “off, low, medium, medium-high, high” 
 + 
 +The default parameter of the Unit Name is optional, if used in an ON or OFF script the current unit will be queried unless you specify a different name.
  
 In XTension the enumerations are stored as a comma delimited string in the enumerated values field of the display tab in the edit unit dialog. They are also used as the values for the popup menu if that is selected as the default control type to present for the unit. In XTension the enumerations are stored as a comma delimited string in the enumerated values field of the display tab in the edit unit dialog. They are also used as the values for the popup menu if that is selected as the default control type to present for the unit.
Line 30: Line 32:
  
 <code applescript> <code applescript>
-write log “after this script the enumeration will be “ & enumerated value of (thisUnit) for (future value)+write log “after this script the enumeration will be “ & enumerated value for (future value)
 </code> </code>
  
 +note that in the above since the script is running in the Units ON script it is not necessary to specify the name of the Unit. The [[dictionary:unitinformation:thisunit|thisUnit]] value will be used to make sure the enumeration comes from the Unit that owns the script.
  
 ====History:==== ====History:====
   * the enumerated value of verb was added in XTension version 9.4.36   * the enumerated value of verb was added in XTension version 9.4.36
   * optional “for” parameter added in XTension version 9.5.3   * optional “for” parameter added in XTension version 9.5.3
dictionary/unitinformation/enumeratedvalue.1684594045.txt.gz · Last modified: 2023/05/20 14:47 by James Sentman