🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.indesign.sdk
1 messages
1 total messages Started by jon.gabilondo Fri, 27 Mar 2009 09:48
Problems adding an script object to IND CS3
#184
Author: jon.gabilondo
Date: Fri, 27 Mar 2009 09:48
90 lines
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 },
			}
		}
	}
};
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads