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

Updated Illustrator - Previously working script now has error

Community Beginner ,
Oct 25, 2017 Oct 25, 2017

Copy link to clipboard

Copied

I'm getting "Error 1220: Illegal Argument" for this line.

textRef.textRange.justification = Justification.CENTER;

If I comment it out the script runs fine. This was working fine before I updated to CC 2018.

Does anyone have any idea why this is throwing an error now?

TOPICS
Scripting

Views

1.1K

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
Adobe
Valorous Hero ,
Oct 25, 2017 Oct 25, 2017

Copy link to clipboard

Copied

The TextRange object doesn't have justification, it's inside the textRange.paragraphAttributes property. But this doesn't really answer the question -but try it out?

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 25, 2017 Oct 25, 2017

Copy link to clipboard

Copied

I tried this out:

textRef.textRange.paragraphAttributes.justification = Justification.CENTER;

Exact same error unfortunately.

Thanks for replying!

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 25, 2017 Oct 25, 2017

Copy link to clipboard

Copied

It seems work fine in Illustrator CC(ver.22) like below.

スクリーンショット 2017-10-26 9.49.13.png

check your textRef variable when you get an error.

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 27, 2017 Oct 27, 2017

Copy link to clipboard

Copied

hmm...both of these work on Win10, CC2018

var idoc = app.activeDocument;

var sel = idoc.selection[0];

sel.textRange.justification = Justification.CENTER;

sel.textRange.paragraphAttributes.justification = Justification.CENTER;

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 27, 2017 Oct 27, 2017

Copy link to clipboard

Copied

LATEST

Found the solution here.

Re: What's New in Illustrator Scripting CC2018

I guess the text area needs to be populated before changing paragraph attributes in cc2018.

Thanks for the help.

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