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

Javascript Errors in Samples

Explorer ,
Feb 28, 2020 Feb 28, 2020

I'm wanting to jump into learning scripting but quickly run into errors when looking at the example Scripts. The two I have looked at so far are CreateSwatch.jsx and CreateSpotSwatch.jsx. Neither script actually works, They get hungup. Here are the lines of code that are being flagged:
var swatch = docRef.swatches.add();

and a similar looking line from the other file:
var spot = docRef.spots.add();

Why do the example scripts not work? Is scripting something that isn't really supported? The information online is more sparse than almost anything else I have tried to find information on. There are hardly any YouTube tutorials. The Illustrator Scripting Reference Guides were updated on Adobe's website for every version up to CC 2017, but nothing after that (https://www.adobe.com/devnet/illustrator/scripting.html).

TOPICS
Scripting
694
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 ,
Feb 28, 2020 Feb 28, 2020

You mean both scripts from the example scripts folder in Illustrator?
I tried both and they works very well for me.


Maybe you did some beginner mistakes.

 

Which is your Illustrator version?

Did you copied the scripts in the scripting folder and run from menu: File --> Scripts?

Or in which way you tried to run the scripts? From ESTK? With the correct target engine?

 

Questions over question. Please describe the way you tried to work with the scripts - exactly.

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 ,
Mar 02, 2020 Mar 02, 2020
LATEST

I was trying to run them through ESTK. I went back after reading your reply, and tried to just run these two specific scripts within Illustrator; they both work fine when selected within Illustrator.

They do not work when I press the Play button in ESTK. I have it connected to Illustrator fine by selecting Adobe Illustrator 2020 in the top left dropdown. I have tested that it is properly connected but writing something very simple and running it:
app.documents.add(DocumentColorSpace.CMYK);
I have the latest version of Illustrator CC 24.0.2

EDIT: I get this error within ESTK:
an Illustrator error occurred: 1346458189 ('PARM')

 

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