可可脚本桥接和<内容>元件 [英] Cocoa Scripting Bridge and <contents> element

查看:132
本文介绍了可可脚本桥接和<内容>元件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我想脚本的应用程序有一个脚本定义文件,其中包括一个<内容>元素,这是一个隐式指定的容器。

问题,我怎么在使用脚本桥接该元素中有什么?或者可以选择,我怎么送所需的苹果事件进行检索,然后变换一下,我回去到SBObject?

我已经尝试过:

  [文件nameOfKey]
document.nameofKey
[文件内容]
document.contents


解决方案

不知道这是否会帮助,但我注意到,有时你必须使用关键字获取,以实际得到的东西,然后才能访问的其它部分它。所以我会尝试这个...

  [文件获取]内容]
[文档内容]获取]

等。需要注意的是得到是SBObject的实例方法,所以你可以在文档中找到它。

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

解决方案

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.

这篇关于可可脚本桥接和&lt;内容&gt;元件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆