Error when writing an app to be a Final Cut Pro helper app

Hi,

I am adding AppleScript ability to an existing application to allow a final cut pro share destination to use it as a helper app see for details https://developer.apple.com/library/mac/documentation/FinalCutProX/Conceptual/FinalCutProXWorkflowsGuide/Exporting/Exporting.html#//apple_ref/doc/uid/TP40013781-CH3-SW21

I am trying to test my implementation with both script editor and an app called script debugger. I am seeing a -2710 error stating that Can’t make class asset with the offending object being ‘set’ and expected type being ‘pcls’ please help.

Thanks

James

Here is the sdef file and then the script I am trying to call

<!-- use XInclude to include the standard suite -->
<xi:include href="file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)"/>

<!-- specific suite(s) for the application follow... -->
<suite name="ProVideo Asset Management" code="pvam" description="Scripting terminology for Pro Video Asset Management applications.">
    
    <record-type name="asset location" code="aslc">
        <access-group identifier="com.apple.proapps.assetmanagement.import" access="rw"/>
        <property name="folder" code="asfd" type="file" description="Directory in which the asset files exist.">
            <cocoa key="folder"/>
        </property>
        <property name="base name" code="asbn" type="text" description="Base file name of the asset files.">
            <cocoa key="basename"/>
        </property>
        <property name="has media" code="ashm" type="boolean" description="Whether the asset has rendered media">
            <cocoa key="hasMedia"/>
        </property>
        <property name="has description" code="ashd" type="boolean" description="Whether the asset has an XML sescription">
            <cocoa key="hasDescription"/>
        </property>
    </record-type>
    
    <value-type name="user defined record" code="usrf">
        <cocoa class="NSDictionary"/>
    </value-type>
    
    <command name="open" code="aevtodoc" description="Open a document.">
        <access-group identifier="com.apple.proapps.assetmanagement.import" access="rw"/>
        <direct-parameter description="The file(s) to be opened.">
            <type type="file"/>
            <type type="file" list="yes"/>
        </direct-parameter>
        <result description="The opened document(s).">
            <type type="document"/>
            <type type="document" list="yes"/>
        </result>
    </command>
    
    <command name="make" code="corecrel" description="Create a new object.">
        <access-group identifier="com.apple.proapps.assetmanagement.import" access="rw"/>
        <cocoa class="TestMakeCmd"/>
        <parameter name="new" code="kocl" type="type" description="The class of the new object.">
            <cocoa key="ObjectClass"/>
        </parameter>
        <parameter name="at" code="insh" type="location specifier" optional="yes" description="The location at which to insert the object.">
            <cocoa key="Location"/>
        </parameter>
        <parameter name="with data" code="data" type="any" optional="yes" description="The initial contents of the object.">
            <cocoa key="ObjectData"/>
        </parameter>
        <parameter name="with properties" code="prdt" type="record" optional="yes" description="The initial values for properties of the object.">
            <cocoa key="KeyDictionary"/>
        </parameter>
        <result type="specifier" description="The new object."/>
    </command>
    
    <class-extension name="application" extends="application">
        <access-group identifier="com.apple.proapps.assetmanagement.import" access="rw"/>
        <cocoa class="NSApplication"/>
        <property name="name" code="pnam" type="text" access="r" description="The name of the application.">
            <access-group identifier="com.apple.proapps.assetmanagement.import" access="rw"/>
        </property>
        <element type="document">
            <access-group identifier="com.apple.proapps.assetmanagement.import" access="rw"/>
        </element>
    </class-extension>
    
    <class name="document" code="docu" description="A document." inherits="document">
        <access-group identifier="com.apple.proapps.assetmanagement.import" access="rw"/>
        <cocoa class="TestDocument"/>
        <property name="name" code="pnam" type="text" access="r" description="The name of the application.">
            <access-group identifier="com.apple.assetmanagement.import" access="rw"/>
        </property>
        <property name="id" code="ID  " type="text" access="r" description="The unique identifier of the asset">
            <access-group identifier="com.apple.assetmanagement.import" access="rw"/>
        </property>
        <element type="asset">
            <access-group identifier="com.apple.assetmanagement.import" access="rw"/>
            <cocoa key="assets"/>
        </element>
    </class>
    
    <class name="asset" code="aset" description="A media asset.">
        <access-group identifier="com.apple.assetmanagement.import" access="rw"/>
        <cocoa class="TestAsset"/>
        <property name="id" code="ID  " type="text" access="r" description="The unique identifier of the asset">
            <access-group identifier="com.apple.assetmanagement.import" access="rw"/>
            <cocoa key="uniqueID"/>
        </property>
        <property name="name" code="pnam" type="text" access="r" description="Its name.">
            <access-group identifier="com.apple.assetmanagement.import" access="rw"/>
            <cocoa key="name"/>
        </property>
        <property name="location info" code="locn" type="asset location" access="r" description="Location information of the asset.">
            <access-group identifier="com.apple.assetmanagement.import" access="rw"/>
            <cocoa key="locationInfo"/>
        </property>
        <property name="metadata" code="meta" type="user defined record" access="rw" description="Metadata associated to the asset.">
            <access-group identifier="com.apple.assetmanagement.import" access="rw"/>
            <cocoa key="metadata"/>
        </property>
        <property name="dataoptions" code="dopt" type="user defined record" access="rw" description="Data creation options for the asset.">
            <access-group identifier="com.apple.assetmanagement.import" access="rw"/>
            <cocoa key="dataOptions"/>
        </property>
    </class>
</suite>

tell application “Test”
make new asset with properties {name:“MyNewAsset”, metadata:{|com.apple.proapps.share.episodeID|:“MyNewEpisode”}, dataoptions:{|availableMetadataSets|:{“Camera View”, “General View”}}}
end tell