3 Replies Latest reply on Jul 16, 2014 9:29 AM by Larry G. Schneider

    HHow to create a keyline around the document perimeter

    InMarketing

      Hey guys,

       

      I am trying to create a keyline around the document instead of using the crop mark. I would like to automate this task for each documents for any size I create. Does somebody tried to set up a applescript for that?

      I found a bunch of script about how to create a stroke for text frame but I don't know how to create a black stroke in the size of my artboard.... Help me please!

       

      Thanks

        • 1. Re: HHow to create a keyline around the document perimeter
          Chinnadk Level 4

          Is this you asking?

           

          var doc = app.activeDocument, pages = doc.pages, 
          width = doc.documentPreferences.pageWidth, height = doc.documentPreferences.pageHeight, 
          oldRO = doc.viewPreferences.rulerOrigin; 
          doc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN; 
          
          for(var i=pages.length-1;i>=0;i--) 
          { 
                  var txfm = pages[i].textFrames.add(); 
                  txfm.strokeWeight = 1; 
                  txfm.strokeType = "Solid"; 
                  txfm.geometricBounds = [0,0,height,width]; 
              } 
          doc.viewPreferences.rulerOrigin = oldRO;
          

           

          Regards,

          Chinna

          • 2. Re: HHow to create a keyline around the document perimeter
            InMarketing Level 1

            Hey Chinnadk,

             

            It could be this. I have copied and pasted the applescript you gave me but there is an error at the first line. I don't know how to fix that. Do I also need to write this : tell application Indesign CS6?

             

            Thanks for your help. I really appreciate.

             

            Regards, Vincent

            • 3. Re: HHow to create a keyline around the document perimeter
              Larry G. Schneider Adobe Community Professional & MVP

              It's not an AppleScript but rather an ExtendScript (Adobe version of Java). In Adobe Utilities there should be an ExtendScript folder. Just launch the ExtendScript app, open a new file and paste in the above. Just don't include the numbers. Save as a .jsx file. You can try running it from there or place it in the Scripts folder of ID. ExtendScript is cross platform; works on both Mac and Windows.