Hi Friends,
How to change stroke width of all frames eg:rectangle frame, ellipse frame, polygon frame.
Regards,
Balaji
I try to check the strokeColor of each pageitem. Because i need to enable overprint Stroke for 'Anotada' color strokes. But it shows error ''content of this object has multiple values for this graphic attribute' for Grouped object.
my code:
var doc = app.activeDocument;
for (var i = 0; i < doc.allPageItems.length; i++) {
app.selection = doc.allPageItems[i];
var ObjName = doc.allPageItems[i].constructor.name;
if (doc.allPageItems[i].strokeColor.name == "Anotada")
{
}
}
Please help me.
Let's enclose it with try-catch block:
var doc = app.activeDocument;
var color = doc.swatches.item("Anotada");
for (var i = 0; i < doc.allPageItems.length; i++) {
try {
if (doc.allPageItems[i].strokeColor == color) {
doc.allPageItems[i].overprintStroke = true;
doc.allPageItems[i].strokeWeight += 1;
}
}
catch(err) {
$.writeln(err.message + ", line: " + err.line);
}
}
Okay, it does not work. So what doesn't work?
(After trying) oh, it says this
Error Number: 55
Error String: Object does not support the property or method 'PageItem'
Your selection already is a page item (or it should be, when you selected just "objects"). Use this instead:
var change = app.selection;
for(var idt=0;idt<change.length;idt++)
{
change[idt].strokeColor = "None";
change[idt].strokeWeight = 0;
}
There is a slight over-kill here, because setting the stroke color to [None] will automatically set the weight to 0, but that's nothing dramatic.
Thanks for the reply Jongware. I tried this earlier in my futile attempts, but the stroke stayed the same on the test 'text frame'
Maybe I'm saying it wrong - in terms of I would like to select text frames, graphic frames and unassigned ones and set them to "None"
Do I need to target these pageItems separately?
(I'm running CS5.5, OSX 10.6)
Thanks again
North America
Europe, Middle East and Africa
Asia Pacific