I'm trying to express a slice ("thru in AppleScript") in Objective-C using Scripting Bridge. The example code is making a selection in iWorks Pages. The AppleScript code looks like this
tell application "Pages"
tell document 1
select (characters 8 thru 14)
end tell
end tell
and the Objective-C code is here. What I need is a way of expressing (characters 8 thru 14) in Objective-C.
PagesApplication *app;
app = [SBApplication applicationWithBundleIdentifier:@"com.apple.iWork.Pages"];
SBElementArray *docs = [app documents];
PagesDocument *doc = [docs objectAtIndex:0];
// now we need to express
// "select (characters 8 thru 14)" in obj-c
// ??
Thankful for any help. Björn
I had to use low level AppleEvents. Did monitor the Apple Events from the command line. Here is a code that does it: