Copy link to clipboard
Copied
I suspect the answer is no, but is there a way to do this? I've got 60 files originally made by rhesus monkeys and they found the "lock" command.
Thanks.
Ariel,
There is no need to loop through allPageItems. It's just slow and pointless.
allPageItems returns all items no matter if they are grouped or not.
If you noticed, you can't lock object which is inside of group.
Therefore, using simple one line of code you can unlock all
items in the document like Jongware did in his post:
app.activeDocument.pageItems.everyItem().locked = false;
To unlock items just on master pages use this:
...app.activeDocument.masterSpreads.everyItem().pageItems.everyItem().locked
Copy link to clipboard
Copied
I have a hunch that it could be scripted. One of our scripting gurus may answer whether it's possible.
Copy link to clipboard
Copied
user Harbs has answered this question in an earlier thread:
http://forums.adobe.com/message/2988802
EDIT: or Jongware's answer in this earlier thread:
http://forums.adobe.com/message/3725137
admittedly, searching on the forum's indesign scripting site sucks. user John Hawkinson suggested a better way of searching it. to quote him directly:
Use google instead, you can specify site:forums.adobe.com +"indesign scripting"
Copy link to clipboard
Copied
Lovely, thanks.
At least they weren't marmosets, or everything would be on a non-printing layer, too.
Copy link to clipboard
Copied
While in InDesign, click on 'Object' from the Menu options and select 'Unlock All on Spread'. See if it helps.
Rachit
Copy link to clipboard
Copied
Thanks, but there are 1,013 spreads, so I'd like to avoid that.
Got the script running. So far, so good.
Thanks, all.
Copy link to clipboard
Copied
Untested, but try this little script:
items = app.activeDocument.allPageItems;
for (a=0; a<items.length; a++){
items.locked = false;
}
Ariel
Copy link to clipboard
Copied
or the OP should try ariel's script above... just tested in CS5 (mac) and it works there.
Copy link to clipboard
Copied
The simple one works in CS5.5; will try the other if anything changes.
Thanks again.
Copy link to clipboard
Copied
Ariel,
There is no need to loop through allPageItems. It's just slow and pointless.
allPageItems returns all items no matter if they are grouped or not.
If you noticed, you can't lock object which is inside of group.
Therefore, using simple one line of code you can unlock all
items in the document like Jongware did in his post:
app.activeDocument.pageItems.everyItem().locked = false;
To unlock items just on master pages use this:
app.activeDocument.masterSpreads.everyItem().pageItems.everyItem().locked = false;
To unlock all items just on pages, not master pages:
app.activeDocument.pages.everyItem().pageItems.everyItem().locked = false;
Hope that helps.
--
Marijan (tomaxxi)
http://tomaxxi.com
Copy link to clipboard
Copied
Hi Marijan,
Thanks that's good. I thought of allPageItems.everyItem() but then I saw
that it returned an array, not a collection, so it didn't work. At the
back of my mind I remembered that there was an object that would work
with everyItem() but I couldn't remember offhand what it was.
Ariel
Copy link to clipboard
Copied
It works great!
Can you add pages range to these code lines? So that you can unlock only specific pages in the document, e.g. from 12-50?
PS My problem is "find and replace" on specific pages, the only solution is to block the entire document and unlock the pages on which I want to make changes.
Copy link to clipboard
Copied
You didn't say what version of InDesign?
InDesign CS5 you can open the Layers panel, here there is a triangle to expand the layer.
And you can unlock all items by clicking and holding and sliding down the side with the locks on it.
Copy link to clipboard
Copied
Or use the Sub menu and choose "unlock all"
Copy link to clipboard
Copied
You can also try this script which is now apparently only accessible via the WayBackMachine.
It worked great for me in Insdesign CC2021 to unlock every element in a 280-page document.
Copy link to clipboard
Copied
Hi erique,
Marijan (tomaxxi) gave the correct answer back in 2011.
His ExtendScript (JavaScript) code is still working.
Even with the lastest version of InDesign 2021.
Perhaps one could add another line of code that also unlocks all layers of the active document:
app.activeDocument.layers.everyItem().locked = false ;
app.activeDocument.pageItems.everyItem().locked = false;
FWIW: An expanded version could also memorize all locked objects so that a user will be able to lock all items that were unlocked later.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hello guys,
can you please let me know how to run this scritp ?
Copy link to clipboard
Copied
Hi @Amr.Hamdy ,
copy the code to a text editor and save it without any formatting with the file suffix *.jsx for ExtendScript.
How to install a script file in your User folder so that the script is showing up in the Scripts panel:
https://helpx.adobe.com/indesign/using/scripting.html
Also this:
https://creativepro.com/files/kahrel/indesign/script-info.html
And that:
https://www.indiscripts.com/pages/help#hd0sb2
Regards,
Uwe Laubender
( Adobe Community Professional )
Copy link to clipboard
Copied
@Laubender Thanks man,