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

Is it possible to loop through live paint objects and expand in Javascript?

Enthusiast ,
Apr 30, 2017 Apr 30, 2017

Copy link to clipboard

Copied

I have a lot of live paint objects in a document and would like to loop through and expand them, but there is no option for "Select > Object" in the menu. I looked through documentation and only found 2 mentions of livepaint, but neither for detection, and are only related to to Tracing Options. Anyone know if this is possible with scripting?

TOPICS
Scripting

Views

1.4K

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

Enthusiast , Nov 14, 2017 Nov 14, 2017

Looping has been problematic recently causing my scripts to run too long. I had one that was looping through 30,000+ page items that took over 15 minutes to check visibility, and delete invisible objects.

I found recently, that I don't even need to loop through, it's as simple as:

          app.executeMenuCommand ('selectall');
          app.executeMenuCommand('Expand Planet X');


I've been using select all with a bunch of other commands like outline stroke and text, and it saves a lot of time.

Votes

Translate

Translate
Adobe
Community Expert ,
May 01, 2017 May 01, 2017

Copy link to clipboard

Copied

sure, Live paint objects are "pluginItems" also known as Planet x objects

var idoc = app.activeDocument;

var livepaintObject = idoc.pluginItems[0];

livepaintObject.selected = true;

app.executeMenuCommand('Expand Planet X');

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
Valorous Hero ,
May 01, 2017 May 01, 2017

Copy link to clipboard

Copied

Maybe when Live Paint was first invented, it was thought to be such an advanced feature that it was "far out", as "in outer space". Who knows, but I'm curious

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 ,
May 01, 2017 May 01, 2017

Copy link to clipboard

Copied

me too, aren't we programmers encouraged to give our objects more descriptive names? it'll be great to know how did planet x came about.

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
Enthusiast ,
May 01, 2017 May 01, 2017

Copy link to clipboard

Copied

Once again saving the day! I will try this out. I think that we need to come together as a community and crowd fund documentation of the more obscure features of Illustrator Scripting. Otherwise, I'm going to continue to ask stupid questions to the community, in hope of building a database of answers. The Adobe documentation that does exist is helpful, but is limited, and in current day doesn't allow copy/paste without unlocking.

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
Valorous Hero ,
May 02, 2017 May 02, 2017

Copy link to clipboard

Copied

I think this forum's 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
Enthusiast ,
Nov 14, 2017 Nov 14, 2017

Copy link to clipboard

Copied

LATEST

Looping has been problematic recently causing my scripts to run too long. I had one that was looping through 30,000+ page items that took over 15 minutes to check visibility, and delete invisible objects.

I found recently, that I don't even need to loop through, it's as simple as:

          app.executeMenuCommand ('selectall');
          app.executeMenuCommand('Expand Planet X');


I've been using select all with a bunch of other commands like outline stroke and text, and it saves a lot of time.

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