unit property containing list?
Bob Ober
rmober123 at comcast.net
Sun Oct 13 10:33:01 EDT 2013
Sounds to me like you need to create a list or a group that can be
called from the script.
Bob
On 10/13/13 7:50 AM, ard jonker wrote:
> Hello Listas,
>
> Xtension her has a few pseudo units set properties in a series of other units.
> The ON script for e..g. the kitchen motion detector is
>
> set ToUnits to {"light kitchen", "fumehood", "boiler"}
> setproperties(((thisUnit)), ToUnits, 1)
>
> where setproperties is
>
> on setproperties(FromUnit, TheUnits, theValue)
> if class of TheUnits is list then
> repeat with aUnit in TheUnits
> setproperties(FromUnit, aUnit, theValue)
> end repeat
> else
> Set Unit Property FromUnit in unit TheUnits to theValue
> end if
> end setproperties
>
>
> I noticed that the ON and OFF scripts need to use the same ToUnits list.
> Manually keeping the list equal in the ON and OFF script is error prone.
> I'd rather store them once in a (text) unit property and then by command of something like
> set myList to ((Get unit Property "alist" from unit (thisUnit)) as list)
> set them for the setproperties() script.
> How does one store a {"item1","item2","item3"} list in a unit property?
>
> I've tried the above and also
> set myList to (Get unit Property "alist" from unit (thisUnit))
> but both get me the error message
> OSAError -1708: "alist" doesn’t understand the Get Unit Property message.
>
> Any hints? Any much smarter ways of solving this?
>
> Cheers,
> Ard
> _______________________________________________
> XTensionList mailing list
> XTensionList at shed.com
> http://shed.com/mailman/listinfo/xtensionlist
>
More information about the XTensionList
mailing list