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!
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.
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)