Skip to main content
Participating Frequently
April 11, 2015
Question

How to wait for events from CEP/HTML extension

  • April 11, 2015
  • 1 reply
  • 658 views

Hello

Working on a plugin that uses an html extension to create some 'art'.

When saving, it is necessary to invoke the html extension on each of the plugin 'arts' added, which currently is done using  a kAISaveCommandPreNotifierStr callback. The problem is that the pre notify callback just sends out events to the html extension that asynchronously will process them. By the time these are finished, AI has already finished saving the document and the updated art "arrives" too late in the C++ code

Not sure what the best way fwd is. Ideally it would be nice just to able to wait for the html extension event(s) but I can't seem to get that going. Everything I tried blocks the complete "event loop" and so the html extension gets blocked or the notification event from the html extension is not processed.

Anyone any thoughts on this? Are there alternative approaches to sync C++ code on html events?

All tips warmly welcomed!

Tx

Peter

This topic has been closed for replies.

1 reply

OP_Prepress
Inspiring
April 22, 2015

What about using the kAIDocumentWritePreprocessNotifier - i am not sure, but I had the feeling when sending this, AI is waiting for your code to be done.

Participating Frequently
April 25, 2015

Thanks for the tip. Once I am back in this part of the code, I will try what you suggest.

(It's a pity though one has to rely on a trial and error approach in a lot of AI plugin development areas, never sure whether a next release will not break some of the behavior detected in this trial and error approach)