Skip to main content
Participant
August 8, 2023
Question

How to execute a script before saving or exporting a document

  • August 8, 2023
  • 1 reply
  • 219 views

Hi all,

 

I am working on a task which needs to automatically check certain information of the document upon user save or export an Illustrator document,  e.g., check the size of the artboard or file metadata and inform the user if the document doesn't conform to the standard.

 

As of now I have not find any way to register a callback only within a jsx script. When I was investigating on CEP,  I find it is possible to register callback to certain event, includes "documentAfterSave" but not before save. The available events are very limited. May I know whether there are available events that are not dcoumented here ?

 

Also great appreciate if anyone can provide insight on what's the best way to accomplish this task.

This topic has been closed for replies.

1 reply

Legend
August 9, 2023

It seems that C++ plugin AIHostAdapter provides events such as before save.

There is a CEP called IllustratorEventManager, similar to Photoshop’s script event manager. You can use it or refer to it.