Applescript-objc - accessing class properties

275 views Asked by At

If I have a class BFLocation and I pass an array of those objects into my applescript-objc, how do I access the class properties?

BFLocation.h

@property NSString *url;

BFManager.h

#import "BFLocation.h"

@interface script : NSObject

- (void)processLocations:(NSArray *)locations;

@end

BFManager.applescript

script BFManager

property parent : class "NSObject"

on processLocations_(locations)
    repeat with location in locations
         log location's url
    end repeat
end processLocations

I get <NSAppleEventDescriptor: 'obj '{ 'form':'prop', 'want':'prop', 'seld':'url ', 'from':'obj '{ 'form':'ID ', 'want':'ocid', 'seld':'optr'($C0FF060080610000$), 'from':null() } }>

Do I need to cast location so it knows it's a BFLocation object? Why am I getting an NSAppleEventDescriptor instead of the expected string?

1

There are 1 answers

0
dcg On

Did not have the syntax correct, should be

location's |url|()