0
我試圖在使用Scripting Bridge的Objective-C中表示切片(「通過AppleScript」)。 示例代碼正在iWorks Pages中進行選擇。 的AppleScript的代碼看起來像這樣用ScriptingBridge表示一個範圍(或切片)
tell application "Pages"
tell document 1
select (characters 8 thru 14)
end tell
end tell
和Objective-C的代碼是在這裏。我需要的是在Objective-C中表達(字符8到14)的方法。
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
// ??
感謝您的幫助。 Björn