Monday, April 22, 2019

#1 2018-09-20 07:18:28 am

robdut
Member
Registered: 2009-09-02
Posts: 305

Can't get AppleScript boolean in OBJc class

Hi All,

I have an AppleScript helper app and call certain methods in the delegate from an OBJc class.

BOOL isVolume = [apDel checkIfDiskExists:destString];

in delegate apDel:

Applescript:

if diskName is not in listVolumesFolder then
   my nLog:"The disk is not mounted" withArg:""
   return false
else
   return true
end if

This used to work, the returned AppleScript false would equate to the BOOL. Now it returns a large number and is read as YES. Trying different coercions but no luck so far. Something obvious I'm sure.

Thanks, Rob

Last edited by robdut (2018-09-20 07:18:55 am)

Offline

 

#2 2018-09-20 07:46:20 am

robdut
Member
Registered: 2009-09-02
Posts: 305

Re: Can't get AppleScript boolean in OBJc class

Ok answered my own question...


changed return declaration from BOOL to NSNumber  and it works.

-(BOOL)checkIfDiskExists:(NSString*)destString; (no deal)

-(NSNumber*)checkIfDiskExists:(NSString*)destString; (changes it from large integer back to 0 or 1)


BOOL isVolume = [apDel checkIfDiskExists:destString];

false == YES!

Rob

Last edited by robdut (2018-09-20 07:47:08 am)

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)