2
Explorer
,
/t5/illustrator-discussions/change-text-color-in-group/td-p/11235022
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Community Expert
,
Jun 24, 2020
Jun 24, 2020
Try changing TextFrameItem to TextFrame
-Manan
Explore related tutorials & articles
Community Expert
,
/t5/illustrator-discussions/change-text-color-in-group/m-p/11235050#M182608
Jun 24, 2020
Jun 24, 2020
Copy link to clipboard
Copied
Try changing TextFrameItem to TextFrame
-Manan
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
ellipirelli
AUTHOR
Explorer
,
LATEST
/t5/illustrator-discussions/change-text-color-in-group/m-p/11235093#M182611
Jun 24, 2020
Jun 24, 2020
Copy link to clipboard
Copied
It worked, thank you 😄
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

