Remove hidden properties and effects

What type of scripts do you need?

Moderator: byronnash

Post Reply
Jonath
Posts: 1
Joined: October 2nd, 2020, 12:41 pm

How to delete hidden properties (Like Fill - Stroke - Trim Paths of shape layers) and effects from selected layers?
This script removes hidden Fill:

Code: Select all

function myHandler1(g){
if (g.matchName === "ADBE Vector Graphic - Fill" && g.enabled == false) g.remove();
};
function scoutContent(g, handler){
var n, child;
if (!g.content) return;
g = g.content;
for (n=g.numProperties; n>0; n--){
child = g.property(n);
handler(child);
if (Object.isValid(child) && child.content) scoutContent(child, handler);
};
};

scoutContent(app.project.activeItem.selectedLayers[0], myHandler1);

What can I do to:
Affect all selected layers not just one?
Delete all properties and effects not just fill?

Thank you!

Post Reply