Returning a boolean for a call method, how?

About using call method:

I implemented an Objective-C function to be called in Applescript by call method command.

This method should return a boolean. And tried many options including the (BOOL) in the example of the doc but always get a sort of int sometimes just 0 or 1 sometimes an int but never true/false in Applescript. Ok I can do with that but it’s not cool.

I think that if I knew the true class of an Applescript boolean I will probably have the solution but I can’t put my hand on that.

Any idea?

Ok finally I got it, the doc is confusing because sometimes NSBoolean is mentionned with is fact NSString*. Like if NSBoolean is a very abstract type/class so abstract that it doesn’t exists! :slight_smile:

But the solution I founded is through NSNumber:

  • (NSNumber*)getBooleanValue
    {
    return [NSNumber numberWithBool: 12 != 13];
    }

Returns really a boolean (instead of a sort of int) in AppleScripts with the call method command.