Skip to main content
Participant
May 8, 2014
Question

Auto load plugin on event

  • May 8, 2014
  • 1 reply
  • 531 views

Hello

Is there a way for a plugin to check if it is visible (active?), on an event like kAILayerOptionsNotifier, if the user changes the layer options, the plugin appears automatically so the user don't have to go to Window->PluginName and start it.

The problem is not in registering the event, but showing the plugin UI.

The UI is written in Objective-C, if that info helps.

There is an option i used when the UI was written in Flex fPPLib.LoadExtension() to do the same.

Thanks

This topic has been closed for replies.

1 reply

A. Patterson
Inspiring
May 8, 2014

I assume you're talking about how the plugin can be unloaded by Illustrator? If you've subscribed to that notifier, it should automatically load your plugin and send it the notifier. The user shouldn't have to do anything.

That said, it is possible to prevent your plugin from ever being unloaded by calling SPAccessSuite::AcquirePlugin(). You just have to remember to call ReleasePlugin() when the shutdown message comes in.

vstanticAuthor
Participant
May 9, 2014

It seems i have not described the problem very well. So, if for example a user closes the plugin (pressing the little 'x' in the corner of the UI), and later a kAILayerOptionsNotifier is fired which is already added to the notifications with


sAINotifier->AddNotifier(fPluginRef, "AI Layer options Notifier", kAILayerOptionsNotifier, &layerChangeNotifier);


I want the plugin to be visible again.

Thanks