Returns a 'list' of all units of a specified 'type'
unit type (text, the type of unit from list of: all, real, dimmable, smart, analog, discrete, pseudo, blocked, simulated, security)
with extract (returns a unit record with all data about the unit instead of just the name)
The Extract record is detailed here Unit Extract Record
set MyUnitList to unit type "analog" write log "we got this many analog units: " & (count of items of MyUnitList) write log "and here are their names and current values:" repeat with ThisUnitName in MyUnitList write log ThisUnitName & " has a value of " & (value of ThisUnitName) end repeat
2/25/17 removed reference to “wireless” and “passthrough” as those were legacy types with no important meaning in recent versions.