Hello,
im trying to create a button that locks all my Artboards.
Below is an example of my code:
function lockArtboards() {
console.log("Locking Artboards");
scenegraph.root.children.forEach((node) => {
if (node instanceof Artboard) {
node.locked = true;
console.log(node.name + " - Locked: " + node.locked);
}
});
}
Result:
node.locked = true; ^
Plugin TypeError: Cannot set property locked of [object Object] which has only a getter
i also tried using application.editDocument but i get same error:
function lockArtboards() {
application.editDocument((selection) => {
scenegraph.root.children.forEach((node) => {
if (node instanceof Artboard) {
node.locked = true;
console.log(node.name + " - Locked: " + node.locked);
}
}
});
Would anybody know how i can set all artboard layers to be locked within my javascript code?