1

I have included the ScriptingBridge.framework in the target, and it currently shows under Link Binary with Libraries.

I generated a header using:

sdef "/Applications/Address Book.app" | sdp -fh --basename AddressBook

The header was generated ok. However, at compile time, I get the following error:

Undefined symbols: ".objc_class_name_AddressBookPerson", referenced from: literal-pointer@__OBJC@__cls_refs@AddressBookPerson in ServerController.o

1 Answer 1

1

The linking problem disappeared when I removed the offending line: asking a scriptable object for its class (AddressBookPerson).

[AddressBookPerson class]

I replaced the call to class with classForScriptingClass as shown below:

AddressBookApplication *sab = [SBApplication applicationWithBundleIdentifier:@"com.apple.AddressBook"];

NSArray *array = sab.selection;
if ( [array count] > 0 ) {
   AddressBookItem *item = [array objectAtIndex:0];
   if ( item && [item isKindOfClass:[sab classForScriptingClass:@"person"]]) {
      NSString *vCard = [(AddressBookPerson *) item vcard];
   }
}

where "person" is the name of the class as specified in the scripting definition file generated by sdef.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.