A scripting plug-in enhances the capabilities of the JavaScript operation. It can make new global objects accessible from scripts and it can introduce new interface wrappers.
A scripting plug-in must be a COM-like class that implements IScriptingInterface and is placed in the CATID_ScriptingInterface category.
[
object,
uuid(AADB0FA7-53AB-4A64-8B49-B8C345E1EC50),
helpstring("IScriptingInterface Interface"),
pointer_default(unique)
]
interface IScriptingInterface : IUnknown
{
[helpstring("method GetGlobalObjects")] HRESULT GetGlobalObjects([in] IScriptingInterfaceManager* a_pScriptingMgr, [in] IScriptingSite* a_pSite, [in] IUnknown* a_pManager, [in] IDocument* a_pDocument, [in] IConfig* a_pConfig, [in] IOperationContext* a_pStates, [in] RWHWND a_hParent, [in] LCID a_tLocaleID);
[helpstring("method GetInterfaceAdaptors")] HRESULT GetInterfaceAdaptors([in] IScriptingInterfaceManager* a_pScriptingMgr, [in] IScriptingSite* a_pSite, [in] IDocument* a_pDocument);
[helpstring("method GetKeywords")] HRESULT GetKeywords([in] IScriptingInterfaceManager* a_pScriptingMgr, [in] IEnumStringsInit* a_pPrimary, [in] IEnumStringsInit* a_pSecondary);
};
The GetGlobalObjects method is supposed to use the a_pSite argument to register new global objects (like for example the Configuration object or the Application object. The other parameters of the methods can be forwarded to the actual object if needed.
The GetInterfaceAdaptors method should examine the given a_pDocument and if it can provide an interface wrapper for this document, it should register the wrapper using the a_pSite argument. For example if the given document supports the IDocumentImageVector interface, one of the scripting plug-ins registers the VectorImage interface.
The GetKeywords is used to color-key the important keywords in the scripting editor.