Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Unlock all layers in the book

Return to Member Forum

  • Author
    Posts
    • #64358
      jpillar
      Member

      Hi,

      I'm looking for a script that unlocks the layers in the whole book. Is there anything like this?

      Thank's a lot!

    • #64365
      Eugenyus
      Member

      var d = app.activeBook.bookContents.everyItem().fullName;
      for (i=0;i<d.length;i++){
      app.open(d[i]);
      with (app.activeDocument){
      layers.everyItem().locked = false;
      save();
      close();
      }
      }

    • #64374
      jpillar
      Member

      Thank you Eugenyus! It seems to have a syntax error…

    • #64375
      Eugenyus
      Member

      Maybe it's because you're using a mac?..

    • #64377
      jpillar
      Member

      Tested on WIN too, same result (:

    • #64378

      That particular error indicates you saved the file as “RTF” instead of Plain Text.

      See https://creativepro.com/how&#8230;..g-post.php for how to save a script the correct way.

      In that post David says

      .. in the vast majority of cases the code you find will be written in javascript ..

      — Eugenyus doesn't say so but yes, his is a Javascript as well. (The other scripting languages need to be saved in a different way.)

    • #64380
      jpillar
      Member

      Saved as plain text, works now perfectly!

      Thank's to both Eugenyus and Jongware (-;

Viewing 6 reply threads
  • You must be logged in to reply to this topic.
Forum Ads