I am trying to use Apple Pages (from iWork) with Objective-C's Scripting Bridge.
This is the working AppleScript:
tell application "Pages"
set name of item 1 of contents of (get selection) to "myLittleTextBox"
end tell
How can I achieve the same thing in Objective-C with Scripting Bridge?
I tried the tip under Cocoa Scripting Bridge and <contents> element but no luck ...
The strange thing is that reading the properties is no problem:
PagesApplication *myPages = [SBApplication applicationWithBundleIdentifier:@"com.apple.iWork.Pages"];
NSLog(@"myPages.selection.properties:%@",myPages.selection.properties);
... but I've had no luck setting or accessing the objects in the selection.
Of course, I could send the AppleScript via NSAppleScript
but hey, that would be too easy. ;)