1 Reply Latest reply on Feb 7, 2013 5:44 AM by mmcTimmermans

    Host Adapter DOCUMENT_WRITE_PREPROCESS Event, not enough time

    mmcTimmermans

      Dear all

       

      I want to do some stuff before the document saves.

       

      I use the Host Adapter with Illustrator

       

      When I register a handler:

       

      AIEventAdapter.getInstance().addEventListener(AIEvent.DOCUMENT_WRITE_PREPROCESS,handler);

       

      the function gets called when saving, but the document is saved before my actions are finished. Can I get Ilustrator to wait till my function has finished?

      In my case I want to write some XMP data right before the document is saved. Is this impossible? What the point of this Event  if cannot finish your actions before the actual writing of the document is done?

       

      regards

        • 1. Re: Host Adapter DOCUMENT_WRITE_PREPROCESS Event, not enough time
          mmcTimmermans Level 1

          Or to put it different:

           

          How can I do some action before the actual saving of the document is done. How can I update the XMP data before the data is saved?

          How can I make the document saving operation wait for my code to finish?

           

          One hack could be just call the document.save() or document.saveAs() again. But when the user choose some specialised options when he saves a pdf, I don't know this options and will write a pdf with default settings.

           

           

          thanks