Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
2

Events in illustrator

Explorer ,
Dec 11, 2013 Dec 11, 2013

I'm using the next code:

function onLoaded() {

    var csInterface = new CSInterface();

   

    csInterface.addEventListener("documentAfterActivate", onDocActivatedChanged); 

}

function onDocActivatedChanged(event) {

          new CSInterface().evalScript("$il._ext.callFunction()");

}

I have two questions:

- What other events can I use in illustrator?

- How can I use the event return var in the function onDocActivatedChanged?

Best Regards,

  vgcouso

4.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Dec 12, 2013 Dec 12, 2013

If I understand correctly, there is a “documentAfterSave” event, which was fired right after the document was saved. However, Iillustrator does not support this event.

There is no document about this now, and we plan to add a part into cookbook later. “documentAfterActivate”, “documentAfterDeactivate” and “applicationActivate” are the three events supported by Illustrator now. An event may have “type”, “EventScope”, “appId”, “extensionId” and “data” properties, it depends on how the products lik

...
Translate
Participant ,
Dec 11, 2013 Dec 11, 2013

On the Illustrator Scripting Forums:

http://forums.adobe.com/message/5920542#5920542

does this help at all?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Dec 11, 2013 Dec 11, 2013

Please see my answers inline:

- What other events can I use in illustrator?

There are two other events sent by AI: documentAfterActivate and documentAfterDeactivate. The documentAfterActivate event fires when a document has been activated (after new/open document; or after document has retrieved focus). The documentAfterDeactivate event fired when the active document has been de-activated.

- How can I use the event return var in the function onDocActivatedChanged?

AI set two parameters in the event call back return value: event.type is “applicationActivate” and event.appId is “ILST”.

Hope it helps!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 12, 2013 Dec 12, 2013

Exist some event for when save and other?

Where is documented event var?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Dec 12, 2013 Dec 12, 2013

If I understand correctly, there is a “documentAfterSave” event, which was fired right after the document was saved. However, Iillustrator does not support this event.

There is no document about this now, and we plan to add a part into cookbook later. “documentAfterActivate”, “documentAfterDeactivate” and “applicationActivate” are the three events supported by Illustrator now. An event may have “type”, “EventScope”, “appId”, “extensionId” and “data” properties, it depends on how the products like Illustrator assign the value.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 09, 2018 Oct 09, 2018
LATEST

Hi,

is the event parameter returns any document info?

for ex, in "documentAterDeactivate" event returns closed document info in illustrator?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines