4 Replies Latest reply on Jan 5, 2012 6:42 AM by KS_Coastal

    Move all guides to one layer in InDesign (AS)

    KS_Coastal Level 1

      I need to select all the guides in a 20 page document and move them to one layer. The shortcut is easy enough, but when I can only do one page at a time, I lose valueable time. I could really use a script. Any input?

       

      MAC OSX 10.5.8, ID CS5, AS preferred.

        • 1. Re: Move all guides to one layer in InDesign (AS)
          absqua Level 4

          Sorry, JS:

           

          function main(){
                    var doc = app.activeDocument, layer = doc.layers.item("Guides");
                    doc.guides.everyItem().itemLayer = layer.isValid ? layer : doc.layers.add({name: "Guides"});
                    layer.move(LocationOptions.AT_BEGINNING);
          }
          if(app.documents.length > 0){
                    app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Move Guides");
          }
          

           

          Jeff

          1 person found this helpful
          • 2. Re: Move all guides to one layer in InDesign (AS)
            KS_Coastal Level 1

            JS - better than nothing (which is what I have now). :-) Thank you!

            • 3. Re: Move all guides to one layer in InDesign (AS)
              Kevin Parrott Level 2

              gidday KS_Coastal

               

              try this, paste this in script editor, save as file format text file, place it in your scripts panel folder in indesign, you can then run it while your working. (tested using cs5.5 under OSX 10.6.8)(should work under cs5)

               

              tell application "Adobe InDesign CS5.5"

                  if (count documents) > 0 then

                      my MoveGuidesToOneLayer()

                  else

                      display dialog "No documents are open."

                  end if

              end tell

              on MoveGuidesToOneLayer()

                  tell application "Adobe InDesign CS5.5"

                      set myDoc to active document

                      set myLayerName to "Guides"

                      tell myDoc

                          try

                              set myLayer to layer myLayerName of myDoc

                          on error

                              set myLayer to make layer with properties {name:myLayerName}

                          end try

                          set the item layer of every guide to myLayer

                      end tell

                  end tell

               

               

               

              Kev

              • 4. Re: Move all guides to one layer in InDesign (AS)
                KS_Coastal Level 1

                Perfect, perfect, perfect. Thank you!