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();
}
}
Try changing TextFrameItem to TextFrame
-Manan
Copy link to clipboard
Copied
Try changing TextFrameItem to TextFrame
-Manan
Copy link to clipboard
Copied
It worked, thank you 😄