InDesignServer - All Layers are allways unlocked
InDesign Server 2021 and 2022 do unlock all Layers every time a document is opened.
There is no way to know the initial state of the layers. They are always unlocked for the Scripting.
Furthermore, this change is also saved to the document, removing the locks the user did.
I tested this with following script:
var file = new File("C:/Test/Test.indd");
var doc = app.open(file);
for (var i = 0; i < doc.layers.length; i++) {
var layer = doc.layers[i];
app.consoleout("Layer " + layer.name + " Locked: " + layer.locked + " Visible: " + layer.visible);
}
doc.close(SaveOptions.YES);
I've already posted this into the community forum for InDesign, were the issue was confirmed.
Affected Versions: (As far a i could test it)
2021 and 2022
It works correctly in InDesignServer 2020