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

[Scripting] I need to implement a script to change 100,000 pathItems color in 1 time

New Here ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

I need to implement a script like 'recolor artwork' wizard in AI.

And I already wrote a script that loop change pathItems color one by one. It's work for few pathItems. But does not work for my job that contains more than 100,000 pathItems. You know that's too slow.

So, I need help. How can I set color to group of all pathItems in a time ? or do we have a better way to do ?

Best regards

TOPICS
Scripting

Views

376

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
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

Moving to Illustrator Scripting​

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 ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

set the document's defaultFillColor to your desired color and then use an app.executeMenuCommand("Find Fill Color menu item") to select all shapes of one color, or use one of the available selection commands that does not rely on looping such as layer.hasSelectedArtwork = true, to get your shapes selected and then set the document's defaultFillColor to change all in one instance without resorting to a loop.

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
New Here ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

LATEST

Cool. It's work with just 3 lines of code

// choose the source color that will be changed

doc.DefaultFillColor = srcColor;

//  select all object that has the color same source color

app.ExecuteMenuCommand("Find Fill Color menu item");

//  change the color of selected object to dst color

doc.DefaultFillColor = dstColor;

Thank you.

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