Article View: adobe.indesign.sdk
Article #184Problems adding an script object to IND CS3
From: jon.gabilondo
Date: Fri, 27 Mar 2009 09:48
Date: Fri, 27 Mar 2009 09:48
90 lines
3323 bytes
3323 bytes
Hello,
I'm trying to add a suite "MySuite" with an object "MyDb" to manage my database.
For a start I'll be happy adding just a property that will tell me if "is logged".
I do see the suite and the objects in the dictionary, but I can't reach them from the AppleScript.
I don't know if it is a .fr structure problem or the C code implementation.
I understand the object needs a parent so I make it accessible through a property the "application" in BasicSuite.
I would appreciate if someone would tell me what link I'm missing.
I declare the IID_ISCRIPTPROVIDER and the IID_ISCRIPT:
Class {
kMyDbScriptProviderBoss, kBaseScriptProviderBoss, { // OK kBaseScriptProviderBoss ?
IID_ISCRIPTPROVIDER, kMyDbScriptProviderImpl,
}
},
Class {
kMyDbScriptObjectBoss , kBaseProxyScriptObjectBoss, { // OK kBaseProxyScriptObjectBoss ?
IID_ISCRIPT, kMyDbScriptImpl,
}
},
Then the VersionedScriptElementInfo:
resource VersionedScriptElementInfo(20)
{
//Contexts
{
kCobaltScriptVersion, kCoreScriptManagerBoss, kWildFS, k_Wild,
}
//Elements
{
Suite
{
kMyDbSuiteScriptElement, s_MyDbSuite, "My Suite", "Terms applicable to MyDb operations",
}
// this is the object "MyDb"
Object
{
kMyDbObjectScriptElement,
c_MyDb,
"MyDb", // name to access it from scripts
"MyDb Object", // description
kMyDbScript_CLSID, // GUID
NoPluralInfo, //
kNonIDBasedObjectScriptElement, // OK ?
kMyDbSuiteScriptElement, // belongs to my suite
}
/ the property for "application"
Property
{
kMyDbObjectPropertyScriptElement,
p_MyDb,
"MyDb Object",
"Access to MyDb object",
ObjectType( kMyDbObjectScriptElement ),
{}
kNoAttributeClass,
}
// I want that "MyDb" will answer to "is logged"
Property
{
kMyDbeLoggedPropertyScriptElement, // property's script element ID
p_MyDbIsLogged, // script PropID
"is logged", // name
"If user logged in to MyDb", // description
BoolType, // type name
{} // alternate types to be handled
kNoAttributeClass, // attribute class ID
}
Provider
{
kMyDbScriptProviderBoss, // provider boss ID
{
// parent to the represented object
Parent{ kApplicationObjectScriptElement }, // OK to say here that the parent is the application ?
// the represented object
RepresentObject { kMyDbObjectScriptElement },
// in "application" will show as property
ParentProperty{ kMyDbObjectPropertyScriptElement, kReadOnly },
// Property: "is logged"
Property { kMyDbLoggedPropertyScriptElement, kReadOnly },
}
}
}
};
Technical Details
Message-ID:
<59b86ce8.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f63e9,2ec50c9d6ae8611,start X-Google-Attributes: gidf63e9,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: jon.gabilondo@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.indesign.sdk Subject: Problems adding an script object to IND CS3 Message-ID: <59b86ce8.-1@webcrossing.la2eafNXanI> Date: Fri, 27 Mar 2009 02:48:12 -0700 Lines: 99 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit