Copy link to clipboard
Copied
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
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
That's exactly what I was thinking. But I don't know how to put it into code.
Copy link to clipboard
Copied
post a sample showing the marks in the right places
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
got it, I'll put something together...as time permits
Copy link to clipboard
Copied
Thank you very much Carlos!
Copy link to clipboard
Copied
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");
}
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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");
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
you're welcome, what are the dots made of now? can't you break symbol link and expand?
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now