I give up... (resend, did not see on list)

James Sentman james at sentman.com
Fri Oct 27 14:07:20 EDT 2017


So some small progress, thats good :)

The list that is returned is a list of the unit names. They should be just regular strings, no object references or any such overly complicated things.

On my system I have no problem doing: write log “the unit is: “ & workUnit & “ isn’t is”

as the center line of that. So i’m not sure how you can get a conversion error. Are you sure the error is coming from that line and not something else? 

Once you have the name you should be able to use it as the unit name in any other verb at all.  For example I have no problem running this:

set MyList to unit type “all"
write log "there were " & (length of MyList) & " units found"

repeat with WorkUnit in MyList
	write log "found unit: " & WorkUnit & " it's value is: " & (value of WorkUnit)
end repeat

Does that work on your system?


> On Oct 27, 2017, at 10:26 AM, Thomas Arman <tarman at me.com> wrote:
> 
> Ok, that works.  When I wrote this originally last year, one unit was throwing errors so I put the loop over the units into a try block to ignore that unit.
> 
> Now, with a new database of VeraPlus units, the try was tossing out most of them.  I guess I didn’t/don’t understand “what” kind of variable workunit  is!  If I use it in a write to log like: “some text” & workunit & “more text”, it throws a can’t convert error.
> 
> What IS it and how do I pull textual name and state, etc., from it?
> 
> Thanks for your help,
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20171027/ddd26c9b/attachment.html>


More information about the XTensionList mailing list