2 Replies Latest reply on Apr 5, 2017 7:08 AM by davidsonjw

    Add cropmarks defined by page size not selected object

    Sketch_Ak Level 1

      Hi there,


      I have edited down the sample script from Adobe "CropMarks".

      I want this to work based off the current document size and not a selected object.

      Sadly everything I've tried so far just doesn't work? Any help would be great.


      Thank you


      // CROP MARKS 5 offset 5 in length .1 stroke
      var myDocument = app.activeDocument;
      var myLayer = myDocument.layers.add({name:"myCropMarks"});
      var myRegistrationColor = myDocument.colors.item("Registration");
      var myNoneSwatch = myDocument.swatches.item("None");
      var myCropMarkWidth = .1;
      myBounds = myDocument.selection[0].visibleBounds;
      for(var myCounter = 0; myCounter < myDocument.selection.length; myCounter ++){
      myObject = myDocument.selection[myCounter];
      myBounds = myObject.visibleBounds;
      var myX1 = myBounds[1];
      var myY1 = myBounds[0];
      var myX2 = myBounds[3];
      var myY2 = myBounds[2];
      myDrawCropMarks (myBounds[1], myBounds[0], myBounds[3], myBounds[2], myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer);
      function myDrawCropMarks (myX1, myY1, myX2, myY2, myCropMarkWidth, myRegistrationColor, myNoneSwatch, myLayer)