PageItems differences

There are 4 elements in the document, but we see it as one object.
var doc = app.activeDocument;
for (var i = 0, len = doc.pageItems.length; i < len; i++) {
doc.pageItems[i].locked = true;
}
app.executeMenuCommand('unlockAll');for (var i = 0, len = doc.layers[0].pageItems.length; i < len; i++) {
doc.pageItems[i].locked = true;
}
Speed test

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store