Hi,
I'm looking at creating a custom button that would enable to lock a specific layer automatically.
Here's the code I have to lock the specific layer. Any idea if that would be sufficient?
var ocgArray = this.getOCGs();
for (var i=0; i < ocgArray.length; i++) {
if (ocgArray[i].name == "skyline") ocgArray[i].locked = true;
}
app.addToolButton({
cName: "myToolButton",
cExec: "app.alert('Button was pressed')",
cTooltext: "Skyline Button",
cEnable: true,
nPos: 0
});
Thanks,
Bruno
If the former, then you need to place the first part, the part that locks the layer, inside a function and call it using the cExec parameter. Also, move the alert to the body of the function.
If the latter, then what's the point of adding a tool button?
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com