Hello,
I see from the PitStop forum you solved this with colour names as ABC says PitStop does not have the layer functions you need at present.
This is the JavaScript you can use in an Action Wizard in Acrobat.
Add (More Tools) Execute JavaScript.
It's not ideal but it might help someone else.
The script just reverses the visibility of each layer quoted in the script.
Don't mention a layer in the script and it is left alone.
- If LAYER_A was visible it becomes not visible.
- If LAYER_B was not visible it becomes visible.
- If there was a LAYER_Z , it would stay the same.
I am no Java expert but I think you can removed the "this.flattenLayers()" from the end if you want to keep all your layers.
var docOCGs = this.getOCGs();
for (var x=0; x < docOCGs.length; x++)
{
if(docOCGs[x].name == "LAYER_A")
{
docOCGs[x].state = !docOCGs[x].state;
}
}
var docOCGs = this.getOCGs();
for (var x=0; x < docOCGs.length; x++)
{
if(docOCGs[x].name == "LAYER_B")
{
docOCGs[x].state = !docOCGs[x].state;
}
}
var docOCGs = this.getOCGs();
for (var x=0; x < docOCGs.length; x++)
{
if(docOCGs[x].name == "LAYER_C")
{
docOCGs[x].state = !docOCGs[x].state;
}
}
var docOCGs = this.getOCGs();
for (var x=0; x < docOCGs.length; x++)
{
if(docOCGs[x].name == "LAYER_D")
{
docOCGs[x].state = !docOCGs[x].state;
}
}
this.flattenLayers()
Let me know if you have any questions.