Cocoa Scripting Bridge and <contents> element

烈酒焚心 提交于 2019-12-24 21:33:16

问题


So, the application I'm trying to script has a scripting definition file that includes a <contents> element, which is an "implicitly specified container."

The question, how do I get at what's inside this element using Scripting Bridge? Or alternatively, how do I send the Apple Event necessary to retrieve it and then transform what I get back into an SBObject?

I already tried:

[document nameOfKey]
document.nameofKey
[document contents]
document.contents

回答1:


Not sure if this will help but I noticed that sometimes you have to use the keyword "get" in order to actually get something before you can access other parts of it. So I would try this...

[[document get] contents]
[[document contents] get]

etc. Note that "get" is an instance method of SBObject so you can find it in the docs.



来源:https://stackoverflow.com/questions/2909167/cocoa-scripting-bridge-and-contents-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!