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

Can't reference AIHostAdapter.aip in CEP

Community Beginner ,
Oct 27, 2021 Oct 27, 2021

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.");
}
)});

TOPICS
Scripting , SDK , Third party plugins

Views

968

Translate

Translate

Report

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

Community Expert , Oct 28, 2021 Oct 28, 2021

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.

Votes

Translate

Translate
Adobe
Community Expert ,
Oct 28, 2021 Oct 28, 2021

Copy link to clipboard

Copied

Hi,

Did you include the hostadapter js file?

 

Best regards

Votes

Translate

Translate

Report

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 28, 2021 Oct 28, 2021

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?

Votes

Translate

Translate

Report

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 28, 2021 Oct 28, 2021

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.

Best regards

Votes

Translate

Translate

Report

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 28, 2021 Oct 28, 2021

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

Votes

Translate

Translate

Report

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 28, 2021 Oct 28, 2021

Copy link to clipboard

Copied

Please share your code.

Best regards

Votes

Translate

Translate

Report

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 28, 2021 Oct 28, 2021

Copy link to clipboard

Copied

I uploaded the extension (nearly blank, just started) to https://drive.google.com/file/d/1wFFxSB7rAUVHOYuCYK62CZ81XZv2nfMU/view?usp=sharing

Votes

Translate

Translate

Report

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 28, 2021 Oct 28, 2021

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.

Best regards

Votes

Translate

Translate

Report

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 28, 2021 Oct 28, 2021

Copy link to clipboard

Copied

Yes, it worked! Thank you very much! 

Votes

Translate

Translate

Report

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 ,
Dec 04, 2021 Dec 04, 2021

Copy link to clipboard

Copied

LATEST

Hi,

I am also looking for that js file. The dropbox link is no longer valid

 

many thanks

Votes

Translate

Translate

Report

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