dictionary:unitinformation:setvalueof
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dictionary:unitinformation:setvalueof [2017/10/15 16:06] – James Sentman | dictionary:unitinformation:setvalueof [2023/02/13 14:52] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 7: | Line 7: | ||
===Optional Parameters: | ===Optional Parameters: | ||
- | * **to** (number, any real number. 10, 4.5, 0.567, -5.23)\\ | + | * **to** (number |
* **by** (number, any real number to add to existing value. 5, -45, 3.1415, -9.3)\\ | * **by** (number, any real number to add to existing value. 5, -45, 3.1415, -9.3)\\ | ||
* **with no script** (stops the executing of the script)\\ | * **with no script** (stops the executing of the script)\\ | ||
Line 28: | Line 28: | ||
</ | </ | ||
+ | |||
+ | Some units do not have values that are easily converted to numbers, the Mode setting of a Thermostat for example. If it would make more sense to use a string to describe the value you can do that using an enumerated string. The enumerations come from the “comma separated list for popup” field on the [[xtension_manual: | ||
+ | |||
+ | <code applescript> | ||
+ | --examples using enumerated strings | ||
+ | |||
+ | set value of “Thermostat Mode” to “cool” | ||
+ | |||
+ | -- or | ||
+ | |||
+ | set value of “Thermostate Mode” to “off” | ||
+ | </ | ||
+ | |||
+ | The comparisons are not case sensitive. If the string is not found in the list then the value of the unit will not be set and an error will be returned. | ||
Line 33: | Line 47: | ||
Setting the value to 0 will execute the OFF script, if any. Setting the value to a non-zero value will run the ON script if any.\\ | Setting the value to 0 will execute the OFF script, if any. Setting the value to a non-zero value will run the ON script if any.\\ | ||
\\ | \\ | ||
- | You can use this verb instead of the [[dictionary: | + | You can use this verb instead of the [[dictionary: |
+ | |||
+ | ===History: | ||
+ | |||
+ | * The ability to pass an enumerated string to the set value verb was added in XTension version 9.4.36. |
dictionary/unitinformation/setvalueof.1508083614.txt.gz · Last modified: 2023/02/13 14:51 (external edit)