Skip to main content
Participant
August 31, 2011
Answered

Unlock all objects in document(s)?

  • August 31, 2011
  • 7 replies
  • 31350 views

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.

    This topic has been closed for replies.
    Correct answer tomaxxi

    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

    7 replies

    Community Expert
    December 3, 2020

    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 )

    Amr.Hamdy
    Known Participant
    August 23, 2022

    Hello guys,

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

    Community Expert
    August 23, 2022

    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 )

    Participant
    December 3, 2020

    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_Page_Items.jsx.zip

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

    Community Expert
    September 1, 2011

    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.

    Community Expert
    September 1, 2011

    Or use the Sub menu and choose "unlock all"

    TᴀW
    Legend
    August 31, 2011
    Colin Flashman
    Community Expert
    Community Expert
    August 31, 2011

    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!
    TypeflowAuthor
    Participant
    September 1, 2011

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

    Thanks again.

    Participating Frequently
    August 31, 2011

    While in InDesign, click on 'Object' from the Menu options and select 'Unlock All on Spread'. See if it helps.

    Rachit

    TypeflowAuthor
    Participant
    August 31, 2011

    Thanks, but there are 1,013 spreads, so I'd like to avoid that.

    Got the script running. So far, so good.

    Thanks, all.

    Colin Flashman
    Community Expert
    Community Expert
    August 31, 2011

    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!
    TypeflowAuthor
    Participant
    August 31, 2011

    Lovely, thanks.

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

    Steve Werner
    Community Expert
    Community Expert
    August 31, 2011

    I have a hunch that it could be scripted. One of our scripting gurus may answer whether it's possible.