«four character codes» from record using try...error

Hey,

I’m trying to capture an error message to parse record labels but keep getting an unexpected result.

What the heck am I doing wrong?

tell application "IndigoServer"
	try
		set p to (get properties of device 1)
	on error err_msg
		 err_msg
	end try
end tell

(* -- results: properties record (as desired)...
{name:"master bedroom iTunes keypad", description:"", address:"01.1C.B6", type:insteon, model:"KeypadLinc V2 Dimmer", display in remote ui:true, on state:false, brightness:0, temperatures:{}, humidities:{}, heat setpoint:0.0, cool setpoint:0.0, hvac mode:offMode, fan mode:fanAutoOn, zone index:0, binary outputs:{}, binary inputs:{}, analog inputs:{}, sensor inputs:{}, last changed:date "Thursday, August 31, 2006 8:13:31 PM", supports on off:true, supports dimming:true, supports sprinkler:false, supports multiple i/o:false, supports hvac:false, «class SIr »:false, «class SVid»:false, supports all lights on and off:true, supports all off:true, supports status request:true}
*)

tell application "IndigoServer"
	try
		set p to (get properties of device 1)
		p as boolean -- generate error
	on error err_msg
		err_msg
	end try
end tell

(* -- results: four character codes
"Can't make {name:\"master bedroom iTunes keypad\", «class Desc»:\"\", «class X10a»:\"01.1C.B6\", «class DvTy»:«constant ****insT», «class DvTp»:\"KeypadLinc V2 Dimmer\", «class DsUI»:true, «class Stat»:false, «class Brns»:0, «class Temp»:{}, «class Hmdt»:{}, «class HtSt»:0.0, «class ClSt»:0.0, «class HvMd»:«constant ****HvAO», «class HvFd»:«constant ****HvFA», «class SpkZ»:0, «class bnOp»:{}, «class bnIp»:{}, «class anIn»:{}, «class snIn»:{}, «class LsCh»:date \"Thursday, August 31, 2006 8:13:31 PM\", «class SOnF»:true, «class SDim»:true, «class SSpr»:false, «class SMio»:false, «class SHvc»:false, «class SIr »:false, «class SVid»:false, «class SAl1»:true, «class SAl2»:true, «class SSRq»:true} into type boolean."
*)

Thanks, Greg

Model: Mac Pro
AppleScript: 2.0.1
Browser: Safari 525.20.1
Operating System: Mac OS X (10.5)

The problem has been fixed by altering the method used to generate the error.

Note: There are two class IDs that don’t have labels defined within the original application, “IndigoServer”.

Greg


try
	tell application "IndigoServer"
		set p to (get properties of device 1)
		eeeee of p -- generate error, look for nonexistent label
	end tell
on error err_msg
	err_msg
end try

-----------------
(*
"Can't get eeeee of {name:\"master bedroom iTunes keypad\", description:\"\", address:\"01.1C.B6\", type:insteon, model:\"KeypadLinc V2 Dimmer\", display in remote ui:true, on state:false, brightness:0, temperatures:{}, humidities:{}, heat setpoint:0.0, cool setpoint:0.0, hvac mode:offMode, fan mode:fanAutoOn, zone index:0, binary outputs:{}, binary inputs:{}, analog inputs:{}, sensor inputs:{}, last changed:date \"Thursday, August 31, 2006 8:13:31 PM\", supports on off:true, supports dimming:true, supports sprinkler:false, supports multiple i/o:false, supports hvac:false, «class SIr »:false, «class SVid»:false, supports all lights on and off:true, supports all off:true, supports status request:true}."
*)