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

single command to unlock document

Explorer ,
Nov 17, 2021 Nov 17, 2021

Copy link to clipboard

Copied

I would like to unlock an entire 272 page InDesign 2022 document in one shot. I saw some answers, but didn't know how to implement a script.

TOPICS
How to

Views

827

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 ,
Nov 17, 2021 Nov 17, 2021

Copy link to clipboard

Copied

Can you clarify what you mean by "unlock an entire xx pg InDesign document.."? Thanks.

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 ,
Nov 17, 2021 Nov 17, 2021

Copy link to clipboard

Copied

For each two page spread, to unlock it, I have to press <ctrl><alt> L. A 272 page document has about 136 spreads. I was hoping there was a way I don't have to press ctrl><alt> L    132 times.

 

Lou

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 ,
Nov 17, 2021 Nov 17, 2021

Copy link to clipboard

Copied

Try the following work

var a =  app.documents[0].spreads.everyItem().pageItems.everyItem().getElements()
for(var i = 0; i< a.length; i++)
	a[i].locked = false

 -Manan

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 ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Thanks for the reply and help. I don't know what you mean by "try". Where do I type that? It looks like a programming languate. Are the first two lines stand-alone or is ieally one line that spilled over to the next? 

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 ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

LATEST

I think there is something wrong here. Maybe you expect something else than what we are thinking. So you asked for a script so I presumed that you know how to operate a script, anyhow if you did not know that then Uwe has already explained it. Now by "try" I meant that use the code that I gave and test it to see if it meets your requirements. The code people share on this forum are generally quick solutions without extensive testing. So it may not work as expected many times, it's left to the issue poster to verify and do the necessary due dillegence to see if the script works or not and if it does not then report back with the findings and relevant information to fix the issue. I hope this clears things out. If you still have queries, feel free to fire them we will try our best to provide a resolution.

-Manan

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 ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

I don't know why someone would lock individual items on a large document. Did you check the layers to see if they are locked?

David Creamer: Community Expert (ACI and ACE 1995-2023)

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 ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

>I don't know why someone would lock individual items on a large document.

 

That doesn't answer my question. Is there a way to do it?

 

1. I unlocked all layers.

2. When I finished each spread, I locked it because I was having problems with a short cut. When I went from the text tool to the selecton tool using (I think) <ctrl- v) I later found that tracks of text all over the document had been replaced with single "v". There were other problems with photos and talk bubbles being nudged out of place. Thus one by one, I locked each finished spread to avoid inadvertent mistakes and wasted time. I couldn't just lock my text layer because I had to perfect the next spread. 

3. I am using this large documents structure to create another rather than start over.  This is why I was looking for a way to unlock all at once. Since I needed to work while waiting for an answer, I have alreday unlocke the first 50 spreads. I still wanted an answer for the rest or for future books. 

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 ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Sorry--I thought you received a document that was already locked. The script already posted would be your best bet. 

 

Use the Escape key to go from the Type tool to the Selection tool, not "v". 

David Creamer: Community Expert (ACI and ACE 1995-2023)

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 ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Thanks. Um, I have been using this program to create a newsletter since PageMaker 4.0. I am a learning amatuer. I don't know much about scripts, except that they are instructions to automate a task. I don't know how to use them. At what location  or environment should I type a script?

 

I appreciate the time you are giving me. I wish I knew more so I could help others.

 

Lou

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 ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

"I saw some answers, but didn't know how to implement a script."

 

If the script code is written in ExtendScript (JavaScript) see for example this:

https://www.indiscripts.com/pages/help#hd0sb2

 

The script code to unlock all items should also unlock all layers as well.

My suggestion is this:

//ExtendScript (JavaScript) to unlock all items of a document

var doc = app.documents[0];
doc.layers.everyItem().locked = false;
doc.pageItems.everyItem().locked = false;

 

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 Expert ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

The Primate said: "Since I needed to work while waiting for an answer, I have alreday unlocke the first 50 spreads. I still wanted an answer for the rest or for future books. "

 

What are you waiting for?

There are two scripts posted that will do what you want.

 

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
Explorer ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Ewe,

 

I need to spend some time on your reference to scripts. The reason why I waited is  I didn't know where the typed lines went. I am completely unfamiliar with scripts. I'll work on your solution today. What is not a delay is my gratitude for your help and the solution. 

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 ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Never thought so.

Just follow the steps Marc Autret gives at indiscripts.com:

https://www.indiscripts.com/pages/help#hd0sb2

 

How to save script code, just copy the script code to a text editor with no formatting, when on Windows just use the Editor application, when on Mac OS use TextEdit in the mode where no formatting of text is possible, save the pure text file with a *.jsx suffix instead of *.txt or change the suffix later on the file.

 

As a next step open the Scripts panel in InDesign, navigate to the User folder there, open the folder in your file system by using the command on the folder or invoke the context menu and finally move the *.jsx file to that folder. Executing the script from InDesign's Scripts panel can be done with the context menu or a menu command from the selected script file in the User folder. Or do a double-click on the script file in the Scripts panel of InDesign.

 

Allow the script some seconds to do its work.

 

Ah! You could also add one line at the end of my code that will alert you when the script is finished:

 

 

//ExtendScript (JavaScript) to unlock all items of a document
var doc = app.documents[0];
doc.layers.everyItem().locked = false;
doc.pageItems.everyItem().locked = false;

alert("Done!" +"\r"+ "All layers are unlocked. All items on all spreads and all parent spreads are unlocked.");

 

 

What could go wrong?

[1] You have no document open when running the script.

[2] You copied the script code to a formatted text document; that could mean, that the straight quotes in the alert are not straight anymore, but curly.

 

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 Expert ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Hi @The Primate:

 

When I went from the text tool to the selecton tool using (I think) <ctrl- v) I later found that tracks of text all over the document had been replaced with single "v".

The shortcut to move to the Selection tool is v (alone, just tap v) unless you have an insertion point in text, in which case you will add a v at the insertion point, which sounds like what happened. In that scenario, use Esc. This is why the tooltip shows "Selection Tool (V, Escape)".

shortcut.gif

 

~Barb

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 ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Thank you. I don't recall each incident but the reason why I used <ctrl-v> was that the escape key didn't always change the tool. That was another frustration for me. Maybe, as you said, I was at t an insertion point. 

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