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

Change Text Color in Group

Explorer ,
Jun 24, 2020 Jun 24, 2020

Copy link to clipboard

Copied

Hi, I have a quick question. I have a group that consists of paths , but one of the objects is a Text and I want the script to do something different with it than the path objects.

I have tried using the following, but it does not work.

var doc = app.activeDocument;

var group = doc.layers["Icon"].groupItems[0];
    for (var i = (group.pageItems.length) - 1; i >= 0; i--) {
        if (group.pageItems[i].typename == "TextFrameItem") {
            group.pageItems[i].textRange.characterAttributes.fillColor = swatch.color;
        }
    }

 

I also tried to delete the layer which did not work.

        var group = doc.layers["Icon"].groupItems[0];
        for (var i = (group.pageItems.length) - 1; i >= 0; i--) {
            if (group.pageItems[i].typename == "TextFrameItem") {
                group.pageItems[i].remove();
            }
        }

 

TOPICS
Scripting

Views

316

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

Community Expert , Jun 24, 2020 Jun 24, 2020

Try changing TextFrameItem to TextFrame

 

-Manan

Votes

Translate

Translate
Adobe
Community Expert ,
Jun 24, 2020 Jun 24, 2020

Copy link to clipboard

Copied

Try changing TextFrameItem to TextFrame

 

-Manan

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
Explorer ,
Jun 24, 2020 Jun 24, 2020

Copy link to clipboard

Copied

LATEST

It worked, 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