set myRec to {SomeNumber:3.14,
|name|:"nemo",
address:"Tokyo",
language:"Latin",
vehicle:"tandem"}
set
someValue to my getRecValue("SomeNumber",
myRec)
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
on getRecValue(pKeyStr,
pRecord)
------------------------------------
local theDict,
theResult, classResult,
classResultStr
set theDict to
current application's
NSDictionary's dictionaryWithDictionary:pRecord
set theResult to
theDict's valueForKey:pKeyStr
set classResult to
class of
theResult
set classResultStr to
classResult's className() as
text
if
theResult = missing value then
set theResult to
missing value
else
if classResultStr =
"__NSCFNumber" then
set
theResult to theResult as
real
else
set
theResult to theResult as
text
end if
end if
return
theResult
end getRecValue