Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Placing registration marks on the corners of document

New Here ,
Oct 29, 2014 Oct 29, 2014

I have to process a lot of files to be router trimmed which requires them to have very specific registration marks.  There are 2 different marks we have to use.  The first mark is at the top left corner of the image contains 2 .25" dots separated vertically by a 1" gap.  The other mark is one .25" mark that is in the top right, bottom right, and bottom left corners.  I have both of these registration marks saved as symbols (or just AI files).  I want to be able to have the script automatically place the appropriate marks in the corners.  How can this be done?

Thanks!

Chris

TOPICS
Scripting
2.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 30, 2014 Oct 30, 2014

here you go, your symbols must be the first and second in the symbols panel. Top/Left symbol must be the first in the Symbols panel. The other symbol must be the second in the panel

#target Illustrator

//  script.name = addRegistrationSymbols.jsx;

//  script.description = adds custom registration marks (saved as symbols) to each corner of the active arboard;

//  script.required = 2 symbols. Top/Left symbol must be the first in the Symbols panel. The other symbol must be the second in the panel

...
Translate
Adobe
Community Expert ,
Oct 29, 2014 Oct 29, 2014

get the bounds of your art (or document), this will be an array with [left, top, right, bottom] values, then just position your symbols relative to these values.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2014 Oct 30, 2014

That's exactly what I was thinking.  But I don't know how to put it into code. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 30, 2014 Oct 30, 2014

post a sample showing the marks in the right places

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2014 Oct 30, 2014

The dots are right at the edges of the artboard.  The dot in top left is a separate symbol instance while the dots in top right, bottom right & bottom left are the same symbol insntance.Screen Shot 2014-10-30 at 9.32.40 AM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 30, 2014 Oct 30, 2014

got it, I'll put something together...as time permits

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2014 Oct 30, 2014

Thank you very much Carlos!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 30, 2014 Oct 30, 2014

here you go, your symbols must be the first and second in the symbols panel. Top/Left symbol must be the first in the Symbols panel. The other symbol must be the second in the panel

#target Illustrator

//  script.name = addRegistrationSymbols.jsx;

//  script.description = adds custom registration marks (saved as symbols) to each corner of the active arboard;

//  script.required = 2 symbols. Top/Left symbol must be the first in the Symbols panel. The other symbol must be the second in the panel

//  script.parent = carlos canto // 10/30/14;

//  script.elegant = false;

// reference https://forums.adobe.com/thread/1621840

// usage: your symbols must be the first and second in the symbols panel.

if (app.documents.length > 0) {

  var idoc = app.activeDocument;

    var margins = 0;

      

    var bounds = idoc.artboards[idoc.artboards.getActiveArtboardIndex()].artboardRect;

  

    var ableft = bounds[0]+margins;

    var abtop = bounds[1]-margins;

    var abright = bounds[2]-margins;

    var abbottom = bounds[3]+margins;

    var twoDots = idoc.symbols[0];

    var twoDotsInstance = idoc.symbolItems.add(twoDots);

  

    twoDotsInstance.position = [ableft, abtop];

  

    var oneDot = idoc.symbols[1];

    var oneDotInstance = idoc.symbolItems.add(oneDot);

    var h = oneDotInstance.height;

    var w = oneDotInstance.width;

  

    oneDotInstance.position = [abright-w, abtop];

    var dup = oneDotInstance.duplicate ();

    dup.position = [abright-w, abbottom+h];

  

    var dup2 = oneDotInstance.duplicate ();

    dup2.position = [ableft, abbottom+h];

          

}

else {

    alert ("there are no open documents");

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 31, 2014 Oct 31, 2014

Carlos,

This is amazing!  Thank you so much!  It works perfectly.  What do I need to add to this in order to group those objects after they've been added?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2014 Oct 31, 2014

you're welcome, use this version

#target Illustrator

//  script.name = addRegistrationSymbols.jsx;

//  script.description = adds custom registration marks (saved as symbols) to each corner of the active arboard;

//  script.required = 2 symbols. Top/Left symbol must be the first in the Symbols panel. The other symbol must be the second in the panel

//  script.parent = carlos canto // 10/30/14;

//  script.elegant = false;

// reference https://forums.adobe.com/thread/1621840

// usage: your symbols must be the first and second in the symbols panel.

if (app.documents.length > 0) {

  var idoc = app.activeDocument;

    var margins = 0;

      

    var bounds = idoc.artboards[idoc.artboards.getActiveArtboardIndex()].artboardRect;

  

    var ableft = bounds[0]+margins;

    var abtop = bounds[1]-margins;

    var abright = bounds[2]-margins;

    var abbottom = bounds[3]+margins;

    var grpRegMarks = idoc.groupItems.add();

  

    var twoDots = idoc.symbols[0];

    var twoDotsInstance = grpRegMarks.symbolItems.add(twoDots);

  

    twoDotsInstance.position = [ableft, abtop];

  

    var oneDot = idoc.symbols[1];

    var oneDotInstance = grpRegMarks.symbolItems.add(oneDot);

    var h = oneDotInstance.height;

    var w = oneDotInstance.width;

  

    oneDotInstance.position = [abright-w, abtop];

    var dup = oneDotInstance.duplicate ();

    dup.position = [abright-w, abbottom+h];

  

    var dup2 = oneDotInstance.duplicate ();

    dup2.position = [ableft, abbottom+h];

          

}

else {

    alert ("there are no open documents");

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 31, 2014 Oct 31, 2014

Carlos, you do amazing work.  Thank you again.  I've now discovered that the symbol instances do not work with the software we are using on our router.  So I'm going to try to write something based off of this to actually draw the dots on the page each time.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2014 Oct 31, 2014

you're welcome, what are the dots made of now? can't you break symbol link and expand?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 31, 2014 Oct 31, 2014
LATEST

The dots are very simple.  They are just 100% black .25" circles.  The registration mark in the top left corner is two of these circles put 1" apart.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines