行。所以,让我们说:
myCollection
中有一个myObject
课程,一个课程objects
和一个myCollection
媒体,返回NSArray
个myObject
个鉴于我已为.sdef
和myCollection
类正确设置了myObject
文件,我该如何定义我的objects
属性呢?
我的意思是,到目前为止,我可以做类似的事情:
tell application "myApplication"
collection's activeObject's name
end tell
我想要的是能够作为数组的元素访问myObject
:
tell application "myApplication"
set Obj to collection's object 0
end tell
到目前为止,这是我的.sdef(差不多......):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
<dictionary xmlns:xi="http://www.w3.org/2003/XInclude">
<xi:include href="file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)"/>
<suite name="myApplication Suite" code="myRm" description="myApplication Suite">
<class name="application" code="camy" description="myApplication's top-level scripting object." inherits="application">
<cocoa class="myApplication"/>
<property name="myname" code="PEnm" description="The name of the application" type="text" access="r">
<cocoa key="myname"/>
</property>
<property name="currentContents" code="PEnc" description="The current contents" type="text" access="r">
<cocoa name="currentContents" />
</property>
<property name="activeDocument" code="PEad" description="The active document" type="document" access="r">
<cocoa name="activeDocument" />
</property>
</class>
<class name="document" code="cDoc" description="myApplication document">
<cocoa class="myDocument"/>
<property name="alias" code="cDal" description="The document's alias" type="text" access="r">
<cocoa key="alias" />
</property>
<property name="content" code="cDco" description="The document's content" type="text" access="rw">
<cocoa key="content" />
</property>
</class>
</suite>
</dictionary>
我应该怎么做?
答案 0 :(得分:0)
这就是我所需要的:
<class name="editor" code="cDed" description="myEditor">
<cocoa class="myEditor"/>
<element type="document" access="r">
<cocoa name="documents" />
</element>
</class>
<class name="document" code="cDoc" description="myDocument">
<cocoa class="myDocument"/>
....