Applescript-able Cocoa : Reference to NSArray of objects?

OK. So, let's say :

  • I've got a class myCollection, a class myObject and a property objects in myCollection returning an NSArray of myObjects

Given that I have properly set up my .sdef file for the myCollection and the myObject classes, how should I go about defining my objects property there as well ?

I mean, so far I can do something like that :

tell application "myApplication"
     collection's activeObject's name
end tell

What I want is to be able to access the myObjects as elements of an array :

tell application "myApplication"
     set Obj to collection's object 0
end tell

This is my .sdef (almost...) so far:

<?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&apos;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>

How should I go about that?

Answers


That's all I needed :

    <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"/>
        ....

Need Your Help

Apache 2.2.14 + php_apc.dll crash

php windows apache apc

I can't get APC to work on Windows because Apache keeps crashing as soon as I run a php file. Is this issue know and is there a workaround?

Inner class and local variable issues

java swing cardlayout listselectionlistener

Writing a program for a project. I need to use a ListSelectionListener in order to grab the current selection from a JList in order to determine the current card for the CardLayout utilized by the ...