When specifying the any
type for a command result in the Sdef, it seems that one cannot simply return the NS types such as NSNumber
. Instead, one needs to return an NSAppleEventDescriptor
.
However, NSAppleEventDescriptor
is rather limited in the values it can handle. There appears to be no support for floating point numbers such as C's double
type.
How do I return double values for the any
type, then?
10.11 has a direct way, a
doubleValue
property, for system versions prior to 10.11 you can coerce the descriptor with the methodcoerceToDescriptorType
to one of these typesFor example code see AppleScriptToolKit