Copy link to clipboard
Copied
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..
Copy link to clipboard
Copied
Hi guys,
I am still looking into it. I found these links,
And
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..
Copy link to clipboard
Copied
Ai currently doesn't send any ART_SELECTION_CHANGED event.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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:
Ten
Copy link to clipboard
Copied
Thanks for the reply Ten,
Where I can find AIHostAdapter.aip for Illustrator CC 2014?
Copy link to clipboard
Copied
You can find it in the Plug-ins directory under the AIHostAdapterDemo extension.
Ten
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Its working now.
Really appreciate your help.
Copy link to clipboard
Copied
Hello Ten A,
Where I can find AIHostAdapter.aip for Illustrator CC 2017?
Copy link to clipboard
Copied
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.
-Manan
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
also what is the licensing model for AIHostAdapter.aip plugin? is it open source?
Copy link to clipboard
Copied
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.");
}
)});