How to make the layer visible on and off
hi, experts
this script:
var docs = app.documents;
(var = docs.length-1; >= 0; i--) {
docs[i].layers.item("chi").visible = true;
docs[i].layers.item("chi").locked = false;
docs[i].layers.item("eng").visible = false;
docs[i].layers.item("eng").locked = true;
}
alert("done.")
but how can make layer
1. if layer "chi" visible = true; while "eng" visible = false
"chi" locked = false; while "eng" locked = true
just turn the
layer "chi" visible = false; while "eng" visible = true
"chi" locked = true; while "eng" locked = false
just 2 layer switch;
regard
john
try this,
var docs = app.documents; (var = docs.length-1; >= 0; i--) { if(docs[i].layers.item("chi").visible == true && docs[i].layers.item("chi").locked == false) { docs[i].layers.item("chi").visible = false; docs[i].layers.item("chi").locked = true; docs[i].layers.item("eng").visible = true; docs[i].layers.item("eng").locked = false; } else if(docs[i].layers.item("eng").visible == true && docs[i].layers.item("eng").locked == false) { docs[i].layers.item("chi").visible = true; docs[i].layers.item("chi").locked = false; docs[i].layers.item("eng").visible = false; docs[i].layers.item("eng").locked = true; } } alert("done.")
More discussions in InDesign Scripting
adobe
Comments
Post a Comment