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

Support of art selection changed event in Illustrator.

Contributor ,
May 14, 2014 May 14, 2014

Hello All,

I have a flex extension for AI. I am performing some task there when user move any art item. In flex, there is a ART_SELECTION_CHANGED event listener.

Now I have to port it for HTML.. So I am looking for this event or similar to this.

Is there any event to listen the ART_SELECTION_CHANGED in Illustrator for HTML as there is in Flex?

Or Is there any document or something which tells about which events are supported in HTML?

Thanks for any help..

4.9K
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 ,
May 19, 2014 May 19, 2014

Hi guys,

I am still looking into it. I found these links,

Events in illustrator

And

events from eb3

According to the first one,


“documentAfterActivate”, “documentAfterDeactivate” and “applicationActivate” are the three events supported by Illustrator now. - By Zhihong Chen on Dec 12, 2013 3:54 AM

And In second one,

Hi,

Try these events:

DocumentAfterActivate

DocumentAfterDeActivate

ApplicationActive

ApplicationBeforeQuit

DocumentEdited

AppOnline

AppOffline

Best regards,

Hallgrimur

I have tried these events, only these three events are working “documentAfterActivate”, “documentAfterDeactivate” and “applicationActivate” for me.

I just want to make it sure, still only these 3 events are working in AI?

Thanks for any help..

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
Community Beginner ,
Aug 04, 2014 Aug 04, 2014

Ai currently doesn't send any ART_SELECTION_CHANGED event.

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
Community Expert ,
Dec 05, 2014 Dec 05, 2014

You can register for all the CSXS events available to Flex in the HTML CEP extension. You need to load the AIHostAdapter.aip plugin in your Illustrator application and use the cshostadapter.js and aihostadapter.js in your project. I have verified it working on Illustrator CC2014. You can download the plugin, the two js and a sample HTML CEP extension from the following link.

https://github.com/timothybrandspencer/CEP-Resources/tree/master/host_adapters

Thanks,

Manan

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
Participant ,
Mar 16, 2015 Mar 16, 2015

Hi All,

I am also looking for the exact thing. But the above link is not working for me. Anyone have any idea about it..

How we register the art selection change event for Ai in html panels?

Thanks for the help.

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
Community Expert ,
Mar 16, 2015 Mar 16, 2015

First, we need to install "AIHostAdapter.aip" plug-in in "Adobe Illustrator CC 2014->Plug-ins->Extensions".

Below Javascript code is sample of catch ART_SELECTION_CHANGED notifier.

$(function() {

  AIEventAdapter.getInstance().addEventListener(

  AIEvent.ART_SELECTION_CHANGED,

  function(eve) {

  alert(eve.type +" invoked.");

  }

  );

  });

Working image:

スクリーンショット 2015-03-17 8.51.40.png

Ten

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
Participant ,
Mar 18, 2015 Mar 18, 2015

Thanks for the reply Ten,

Where I can find AIHostAdapter.aip for Illustrator CC 2014?

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
Community Expert ,
Mar 18, 2015 Mar 18, 2015

You can find it in the Plug-ins directory under the AIHostAdapterDemo extension.

スクリーンショット 2015-03-18 18.03.54.png

Ten

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
Participant ,
Mar 18, 2015 Mar 18, 2015

Thanks a lot Ten for your help..

Just for the info,

This link is not working for me.. Its giving 404.
https://github.com/timothybrandspencer/CEP-Resources/tree/master/host_adapters

So I get the AIHostAdapter from the following thread,
aihostadapter for illustrator cc 2014 (for use with flex)

Do I have to include any other files like cshostadapter.js and aihostadapter.js? If yes then I am not able to find these files.
Can you help me by sharing a link from where I can download these files?

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
Community Expert ,
Mar 18, 2015 Mar 18, 2015

You don't need any more. Check below zxp.

https://drive.google.com/file/d/0B8WPQj-WNG_TQl94c1l0bzNMM1E/view?usp=sharing

Its working sample Extension.

Ten

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
Participant ,
Mar 18, 2015 Mar 18, 2015

Its working now.

Really appreciate your help.

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 ,
Oct 11, 2018 Oct 11, 2018

Hello Ten A,

     Where I can find AIHostAdapter.aip for Illustrator CC 2017?

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
Community Expert ,
Oct 11, 2018 Oct 11, 2018

You can try the plugins from the following URL, i have not tested them on the latest version of Illustrator but i have confirmed with my team and they seem to have it working so you can give it a try.

Dropbox - Host Adapter.zip

-Manan

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
Adobe Employee ,
Jan 10, 2019 Jan 10, 2019

have verified it (2014 AIHostAdapter.aip plugin) works in 2018 illustrator as-is.. however

i have a usecase to process and write something to xmp before saving the doc

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

using the above call i could write data to xmp but save doesn't wait until the data is written, so document becomes dirty again (shows asterisk)..

how can we tell save action to wait until the processing is done using AIEventAdapter

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
Adobe Employee ,
Jan 11, 2019 Jan 11, 2019

also what is the licensing model for AIHostAdapter.aip plugin? is it open source?

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
Community Beginner ,
Oct 27, 2021 Oct 27, 2021
LATEST

I have placed AIHostAdapter.aip in the plugins/Extensions folder and it is listed in AI System info.

When running the below code I get AIEventAdapter is not defined error. How can I reference to it from CEP extension? I wonder could you please tell me how it works?

AIEventAdapter.getInstance().addEventListener(
AIEvent.ART_SELECTION_CHANGED,
function(eve) {
alert(eve.type +" invoked.");
}
)});

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