NSString as string error

Hi,

(NSBundle's mainBundle()'s bundlePath()) as string

returns

Even though logging the pure NSString returns a correct value.

Thanks in advance,

Richard

Where did you assign NSBundle variable? The following class works for me.

like:

property NSBundle : class "NSBundle"

script anObject
property parent : class "NSObject"

on doSometing()
set x to NSBundle's mainBundle()'s bundlePath() as text
end 
end

property NSBundle : class “NSBundle” of current application

I don’t think thats the point because logging the pure NSString seems to work.

Fixed, the error was telling Mail, putting it inside tell me got it working, thanks for replying!

Well good to hear it is working!

Also back to the property. Outside the class the parent is current application like in normal AppleScript; adding current application is overhead/overkill.