Copy link to clipboard
Copied
Hey
I have 3 selected objects
Each with its own artboard
I'm looking for a script that will change any artboard
According to the selected object
Right now - if I use the standard command - "fit to selected art" it creates one artboard
For all objects together.
What about —?
for (var i = 0; i < app.activeDocument.artboards.length; i++) {
var AB = app.activeDocument.artboards[i];
var ABR = AB.artboardRect;
for (var j = 0; j < app.activeDocument.selection.length; j++) {
var SGB = app.activeDocument.selection[j].geometricBounds;
if ((SGB[2] > ABR[0] && SGB[0] < ABR[2]) && (SGB[3] < ABR[1] && SGB[1] > ABR[3])) {
AB.artboardRect = SGB;
}
}
}
I am unsure what you are asking. This will change pathItem strokes to none.
for (var i = 0; i < app.activeDocument.pathItems.length; i++) {
app.activeDocument.pathItems[i].stroked = false;
}
var curItem,length = app.activeDocument.pathItems.length;
for (var i = 0; i < length; i++) {
curItem = app.activeDocument.pathItems[i];
if(curItem.stroked
&& curItem.strokeColor.spot
&& curItem.strokeColor.spot.name === "CutContour")
{
curItem.stroked = false;
}
}
Copy link to clipboard
Copied
for (var i = 0; i < app.activeDocument.artboards.length; i++) {
var AB = app.activeDocument.artboards[i];
var ABR = AB.artboardRect;
for (var j = 0; j < app.activeDocument.selection.length; j++) {
var SGB = app.activeDocument.selection[j].geometricBounds;
if ((SGB[0] > ABR[0] && SGB[2] < ABR[2]) && (SGB[1] < ABR[1] && SGB[3] > ABR[3])) {
AB.artboardRect = SGB;
}
}
}
Copy link to clipboard
Copied
Hi, thanks, but please take a look at this file at this link:
https://www.dropbox.com/s/beww7kxbdnb99wq/chealk.pdf?dl=0
Choose the 3 squares with the pink contour,
And try running the script.
It does not work the way I should.
Thanks!
Copy link to clipboard
Copied
What about —?
for (var i = 0; i < app.activeDocument.artboards.length; i++) {
var AB = app.activeDocument.artboards[i];
var ABR = AB.artboardRect;
for (var j = 0; j < app.activeDocument.selection.length; j++) {
var SGB = app.activeDocument.selection[j].geometricBounds;
if ((SGB[2] > ABR[0] && SGB[0] < ABR[2]) && (SGB[3] < ABR[1] && SGB[1] > ABR[3])) {
AB.artboardRect = SGB;
}
}
}
Copy link to clipboard
Copied
Hey
If you've already helped me,
I'm enclosing an end of what I wanted.
Attach a file, I need a script that will select all the contour lines and make them none.
https://www.dropbox.com/s/uqmqi0sh1fk58i2/ch.pdf?dl=0
Copy link to clipboard
Copied
Thanks a lot!
Copy link to clipboard
Copied
I am unsure what you are asking. This will change pathItem strokes to none.
for (var i = 0; i < app.activeDocument.pathItems.length; i++) {
app.activeDocument.pathItems[i].stroked = false;
}
Copy link to clipboard
Copied
It removes my contour from the whole document
I only need removal of the
CutCOntour
Copy link to clipboard
Copied
I.e. only the contour of a spot color called "cutcontour"
Copy link to clipboard
Copied
var curItem,length = app.activeDocument.pathItems.length;
for (var i = 0; i < length; i++) {
curItem = app.activeDocument.pathItems[i];
if(curItem.stroked
&& curItem.strokeColor.spot
&& curItem.strokeColor.spot.name === "CutContour")
{
curItem.stroked = false;
}
}