Cocoa Scripting: Returning “null” vs. “missing value”
问题 It appears that AppleScript knows the special value null . How do I return such a value from my Cocoa Scripting based app for a scriptable property? If I return nil ( NULL ) or NSNull for a scriptable property getter from my Cocoa Scripting-based app, the script editor interprets that as missing value . And if I return [NSAppleEventDescriptor nullDescriptor] , AppleScript even shows an error. 回答1: AppleScript uses a typeNull descriptor to indicate unassigned/no value, whereas missing value is