2 Replies Latest reply on Apr 29, 2010 10:15 PM by jay fresno

    Guides in back

    jay fresno Level 1

      I have a bunch of already created InDesign files and need to change the preferences on all of them to "guides in back." Does anyone know of a script to do this?

        • 1. Re: Guides in back
          Shonkyin Level 3

          Here is code for you

           

           

          //Send document guides to back
          //created by Baljeet Singh
          if (app.documents.length > 0)
          {
          alert ("Please close all document and try again");
          exit();
          }
          var dirr = Folder.selectDialog( 'Select Indesign folder');
          app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
          alldocs = getAllfiles( dirr, [], ".indd" );
          var alldocslen = alldocs.length;
          for (l=0; l<alldocslen; l++)
          {
          var doc = app.open( alldocs[l]);
          doc.guidePreferences.guidesInBack = true;
          doc.save(alldocs[l]);
          doc.close(SaveOptions.yes);
          }
          
          function getAllfiles( dir, array, mask )
          {
          var f = Folder( dir ).getFiles( '*.*' );
          for( var i = 0; i < f.length; i++ )
               if( f[i] instanceof Folder )
                    getAllfiles( f[i], array, mask );
               else
                    if( f[i].name.substr( -mask.length ) == mask )
                         array.push( f[i] );
          return array;
          }
          app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
          

           

           

           

          Shonky

          • 2. Re: Guides in back
            jay fresno Level 1

            Shonky,

             

            Thank you so much! You are so fast, and the script works great!