我正在尝试使用Apple页面(来自iWork)与Objective-C的Scripting Bridge。Apple Pages - 脚本桥和选择内容
这是工作的AppleScript:
tell application "Pages"
set name of item 1 of contents of (get selection) to "myLittleTextBox"
end tell
如何能够做到在Objective-C与脚本大桥是一回事吗?
我试图Cocoa Scripting Bridge and <contents> element 下尖,但没有运气...
奇怪的是,读取性能是没有问题的:
PagesApplication *myPages = [SBApplication applicationWithBundleIdentifier:@"com.apple.iWork.Pages"];
NSLog(@"myPages.selection.properties:%@",myPages.selection.properties);
...但我没有运气设置或访问选择中的对象。
当然,我可以通过NSAppleScript
发送AppleScript,但嘿,这太容易了。 ;)
我刚刚更新我的如何得到你想要的答案。 – markhunte