1 Reply Latest reply on Jun 26, 2014 10:24 PM by Chinnadk

    I need to add hairline around document bleed

    Drev srl

      I need a script that add an hairline around document, over the red bleed line.

      Anyone can help me?

        • 1. Re: I need to add hairline around document bleed
          Chinnadk Level 4

          Try this.

           

          var doc = app.activeDocument, pages = doc.pages,
          top = doc.documentPreferences.documentBleedTopOffset,
          inside = doc.documentPreferences.documentBleedInsideOrLeftOffset,
          outside = doc.documentPreferences.documentBleedOutsideOrRightOffset,
          bottom = doc.documentPreferences.documentBleedBottomOffset,
          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";
                  if(pages[i].bounds[1] != 0)
                  {
                          txfm.geometricBounds = [-top,-outside-width,height+bottom,width+outside];
                          i--;
                      }
                  else if(pages[i].bounds[1] == 0)
                  {
                          if(pages[i].side == PageSideOptions.RIGHT_HAND)
                          {
                              txfm.geometricBounds = [-top,-inside,height+bottom,width+outside];
                          }
                          else if(pages[i].side == PageSideOptions.LEFT_HAND)
                          {
                              txfm.geometricBounds = [-top,-outside,height+bottom,width+inside];
                          }
                          else if (pages[i].side == PageSideOptions.SINGLE_SIDED)
                          {
                              txfm.geometricBounds = [-top,-inside,height+bottom,width+outside];
                              }
                      }
              }
          doc.viewPreferences.rulerOrigin = oldRO;
          

           

          Regards,

          Chinna