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.");
}
)});
Hi,
You need to use following
AIEventAdapter.getInstance().addEventListener(
AIEvent.ART_SELECTION_CHANGED,
function (eve) {
alert(eve.type + " invoked.");
}
);
No round brackets after AIEventAdapter.
Let us know if that works for you.
Copy link to clipboard
Copied
Hi,
Did you include the hostadapter js file?
Copy link to clipboard
Copied
Thanks for response.
No, I am trying to get it working for the first time and could not find it to download (links in the forums are dead). Could you please share it?
Copy link to clipboard
Copied
Here is the link to download the file
https://www.dropbox.com/s/p0w5o2rhvb7bz5r/cs_host_adapter-2.0.js?dl=0
Include in your project and give path of this file into your html, the way you load other js files.
Copy link to clipboard
Copied
Thank you. Here is the relevent content in my files:
index.html
<script type="text/javascript" src="cs_host_adapter-2.0.js"></script>
index.js
AIEventAdapter().getInstance().addEventListener(
AIEvent.ART_SELECTION_CHANGED,
function (eve) {
alert(eve.type + " invoked.");
}
);
I am not sure what I am doing wrong but unfortunately I am getting the below error:
Uncaught TypeError: this.initQualifiedEventName is not a function
at EventAdapter (file:///C:/Program%20Files%20(x86)/Common%20Files/Adobe/CEP/extensions/Export_panel/client/cs_host_adapter-2.0.js:24:39)
at AIEventAdapter (file:///C:/Program%20Files%20(x86)/Common%20Files/Adobe/CEP/extensions/Export_panel/client/cs_host_adapter-2.0.js:901:15)
at file:///C:/Program%20Files%20(x86)/Common%20Files/Adobe/CEP/extensions/Export_panel/client/index.js:29:1
Any help would be greatly appreciated
Copy link to clipboard
Copied
Please share your code.
Copy link to clipboard
Copied
I uploaded the extension (nearly blank, just started) to https://drive.google.com/file/d/1wFFxSB7rAUVHOYuCYK62CZ81XZv2nfMU/view?usp=sharing
Copy link to clipboard
Copied
Hi,
You need to use following
AIEventAdapter.getInstance().addEventListener(
AIEvent.ART_SELECTION_CHANGED,
function (eve) {
alert(eve.type + " invoked.");
}
);
No round brackets after AIEventAdapter.
Let us know if that works for you.
Copy link to clipboard
Copied
Yes, it worked! Thank you very much!
Copy link to clipboard
Copied
Hi,
I am also looking for that js file. The dropbox link is no longer valid
many thanks