How to create a script to clear overrides just in one layer?
Hello, people!
Hope you can help me. 😛
I'm trying to edit a script I already use to work in just one layer.
The working script is like this one:
var myOverrideType = OverrideType.ALL;
var allStories = app.activeDocument.stories.everyItem();
try{
allStories.clearOverrides(myOverrideType);
}
catch (e) {}It works just fine. It clears the overrides in all stories in my document.
Right now, I want to change it to clear the overrides just at the stories that are inside a specific layer, since this way I have more control under what overrides I'm clearing.
Here is what I tried and didn't work:
var myOverrideType = OverrideType.ALL;
var myLayer = app.activeDocument.layers.item("text");
try{
myLayer.stories.everyItem().clearOverrides(myOverrideType);
}
catch (e) {}It should had took my layer named "text" and clear all the overrides inside the stories that are inside it.
Is there someone who can help me? What am I doing wrong?
I've alredy tried to look for anwsers everywhere.
Thank you so much in advance. 🙂
