You have to read carefully the sdk documentation (programmers guide). Illustrator plugin system is described. What is a plugin, types of plugins, how it works, how it is loaed, ...... You will learn many, many things. A plugin could be loaded during Illustrator startup and only unloaded at Illustrator shutdown. This plugin could do his "magic" during all that session. And It does not have to be a tool. Notifiers: Plugin must register for the notifiers in which it is interested. The Notifier Suite is used to register and remove notification requests. (See AINotifierSuite). Here it is a sample how it sould be implemented in your plugin. myPlugin.h: //Methods to be implemented. ASErr StartupPlugin(SPInterfaceMessage* message); ASErr AddNotifiers(SPInterfaceMessage* message); ASErr Notify(AINotifierMessage* message); myPlugin.cpp: 1- During startup, you have to register to notifications. (AddNotifiers). /* */ ASErr myPlugin::StartupPlugin(SPInterfaceMessage *message) { ASErr error = Plugin::StartupPlugin( message ); if (error) { return error; } error = AddNotifiers(message); if (error) { return error; } return error; // If StartupPlugin returns an error instead of kNoErr, Illustrator // will try to load this plug-in again later. } 2- subscribe to notifiers. kAICSXSPlugPlugSetupCompleteNotifier in this sample. ASErr myPlugin::AddNotifiers(SPInterfaceMessage* message) { ASErr error = kNoErr; error = sAINotifier->AddNotifier(message->d.self, "myPlugin" kAICSXSPlugPlugSetupCompleteNotifier, kAICSXSPlugPlugSetupCompleteNotifier, &fCSXSPlugPlugSetupCompleteNotifier); if (error) { return error; } return error; } 3- handler (when the notification has been raised). /* */ ASErr myPlugin::Notify(AINotifierMessage* message) { ASErr error = kNoErr; if ( message->notifier == fCSXSPlugPlugSetupCompleteNotifier ) { //Do the magic here.......... } return error; } I hope this will help. Thomas.
... View more