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

Event listener in illustrator

Community Beginner ,
May 09, 2022 May 09, 2022
We have many errors for several eps files and have written several scripts to work properly with manual execution. But some eps files have no errors.

How to write if there is an error on the open illustrator document.

TOPICS
Scripting
709
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
Community Expert ,
May 09, 2022 May 09, 2022

Sorry @javithj89048510

 

Please imagine that you do not know how these files were created and how they are structured. And please also imagine that you do not know what the scripts do (or should do), how and in which script language they are written, nor what error messages there are or are not. You know neither the Illustrator version nor the operating system.

 

Please read your post again from this point of view.

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
Valorous Hero ,
May 09, 2022 May 09, 2022

I suggest this solution: use the try-catch statement to wrap the script!

 

try {

  function myScript () {

    throw new Error("It was a failed script :(");

  }

  myScript();

} catch (e) {

  alert(e.message);

}

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 ,
May 10, 2022 May 10, 2022

Thanks Silly-V

Kindly help me if illustrator have addEventListener method for javascript

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 ,
May 10, 2022 May 10, 2022
LATEST

 

Thanks pixxxelschubser

Kindly help me if the illustrator has addEventListener method for javascript.

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
Guide ,
May 09, 2022 May 09, 2022

There is no global onError event handler or "error" event listener which will do what I think you want.

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 ,
May 10, 2022 May 10, 2022

Thanks femkeblanco,

Kindly help me if the illustrator has addEventListener method for javascript.

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