• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Unlock all objects in document(s)?

Community Beginner ,
Aug 31, 2011 Aug 31, 2011

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.

Views

27.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advisor , Aug 31, 2011 Aug 31, 2011

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

...

Votes

Translate

Translate
Community Expert ,
Aug 31, 2011 Aug 31, 2011

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2011 Aug 31, 2011

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"

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 31, 2011 Aug 31, 2011

Copy link to clipboard

Copied

Lovely, thanks.

At least they weren't marmosets, or everything would be on a non-printing layer, too.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 31, 2011 Aug 31, 2011

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 31, 2011 Aug 31, 2011

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Aug 31, 2011 Aug 31, 2011

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2011 Aug 31, 2011

Copy link to clipboard

Copied

or the OP should try ariel's script above... just tested in CS5 (mac) and it works there.

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 31, 2011 Aug 31, 2011

Copy link to clipboard

Copied

The simple one works in CS5.5; will try the other if anything changes.

Thanks again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Aug 31, 2011 Aug 31, 2011

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Sep 01, 2011 Sep 01, 2011

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 13, 2023 Oct 13, 2023

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 01, 2011 Sep 01, 2011

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 01, 2011 Sep 01, 2011

Copy link to clipboard

Copied

Or use the Sub menu and choose "unlock all"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

You can also try this script which is now apparently only accessible via the WayBackMachine.

https://web.archive.org/web/20151016221507/http://www.premediasystems.com:80/downloads/Lock_Unlock_P...

It worked great for me in Insdesign CC2021 to unlock every element in a 280-page document.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2020 Dec 03, 2020

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 23, 2022 Aug 23, 2022

Copy link to clipboard

Copied

Hello guys,

can you please let me know how to run this scritp ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 23, 2022 Aug 23, 2022

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 02, 2023 Jun 02, 2023

Copy link to clipboard

Copied

@Laubender Thanks man,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines