script TestDoubleReturnAppDelegate
property parent : class "NSObject"
on applicationWillFinishLaunching_(aNotification)
-- Return from Obj-C method
set aNumber to current application's ObjCClass's returnValue()
log aNumber -- 100
log aNumber's |class|() -- NSObject
set aNumber to aNumber as number
log aNumber
log "aNumber: " & aNumber
-- Return from Script method
set aNumber to current application's TestClass's returnNumber()
log aNumber -- 100
log aNumber's |class|() -- NSCFNumber
--set aNumber to aNumber as integer -- THIS WORKS
--set aNumber to aNumber as real -- THIS WORKS
set aNumber to aNumber as number -- THIS FAILS
log "aNumber: " & aNumber
end applicationWillFinishLaunching_
end script
script TestClass
property parent : class "NSObject"
on returnNumber()
return 100
end returnNumber
end script