Skip navigation
yury_petrov
Currently Being Moderated

plugin scripting support

Jun 1, 2012 2:01 AM

Using CS5.5 debug

I have a "root" scripable object:

 

  Object
  {
   kAxioModelObjectScriptElement, // object's script element ID
   c_AxioModelEngine,   // script PropID
   "axiocat engine",  // name
   "access axiocat data model engine", // description
   kCPrefs_CLSID,   // Windows CLSID

   NoCollectionInfo,   // CollectionElementType (scriptID, name, descr, CLSID)
   kPreferencesObjectScriptElement,
   kPreferencesSuiteScriptElement,
  }

.......

  Method

  {

   kAxioModelObjectFindScriptElement,

   e_AxioModelFind,

   "get axiocat object",

   "returns axiocat object",

            ObjectType( kAxioUIObjectScriptElement ),

            "axiocat object or null if not found"

   {

    p_AxioModelId, "key", "object id to find", StringType, kRequired,

   }

  }

 

Method getAxiocatObject(key) returns another object with next FR definition:

Class
{
  kAxioUIObjectScriptBoss,
  kBaseProxyScriptObjectBoss,
  {
   IID_ISCRIPT, kAxioUIObjectScriptImpl,
   IID_ISCRIPTOBJECTKEY, kAxioUIObjectKeyScriptImpl,
  }
},

Class
{
  kAxioUIObjectScriptProviderBoss,
  kBaseScriptProviderBoss,
  {
   IID_ISCRIPTPROVIDER, kAxioUIObjectScriptProviderImpl,
  }
},

  Object
  {
   kAxioUIObjectScriptElement, // object's script element ID
   c_AxioUIObjectClass,   // script PropID
   "axiocat object",  // name
   "axiocat data model object", // description
   kAxioUIObject_CLSID,   // Windows CLSID

   NoCollectionInfo,   // CollectionElementType (scriptID, name, descr, CLSID)
   kNonIDBasedObjectScriptElement, // base object element ID
   kAxioModelObjectSuiteScriptElement,  // suite element ID
  }
..... 
  Provider
  {
   kAxioUIObjectScriptProviderBoss,
   {
    Parent{ kAxioModelObjectScriptElement },
    RepresentObject { kAxioUIObjectScriptElement },
    Property { kAxioUIObjectIdScriptElement, kReadOnly },
   }
  }

 

Question: when I call in script getAxiocatObject(key), ID produce ASSERT:

"HandleMethod request for method 'getAxiocatObject' on object 'axiocat engine' returned value for method 'xxxx'".

But object returned from this method is correct, and I see all object properties successfully.

What this ASSERT mean?

 

kAxioUIObjectScriptProviderBoss implementation, where I have doubt:

AxioUIObjectScriptProvider::::GetNumObjects( const IScriptRequestData* data, IScript* parent )

{

 return 0;

}

AxioUIObjectScriptProvider::AppendNthObject( const IScriptRequestData* data, IScript* parent, int32 n, ScriptList& objectList )
{
return kSuccess;
}



 
Replies
  • Currently Being Moderated
    Jun 1, 2012 12:49 PM   in reply to yury_petrov

    It is a bad idea to name a method "get "..., because get is also an AppleScript keyword. Have you considered to implement a collection instead, and address your object by name?

     

    Anyway, do you use e_AxioModelFind as requestID in your method implementation's call to AppendReturnData() ?

     

    Dirk

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points