问题
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