PHP:myTable.cells[i].bottomEdgeStrokeColor = myTable.cells[i].leftEdgeStrokeColor = myTable.cells[i].rightEdgeStrokeColor = myTable.cells[i].topEdgeStrokeColor =
myColor = 'sw1';//в кавычки вписываешь название своего образца
myTable = app.selection[0];
for(i=0;i<myTable.cells.length;i++){
if(myTable.cells[i].contents){
myTable.cells[i].fillColor=myColor;
myTable.cells[i].bottomEdgeStrokeColor = myColor;
myTable.cells[i].leftEdgeStrokeColor = myColor;
myTable.cells[i].rightEdgeStrokeColor = myColor;
myTable.cells[i].topEdgeStrokeColor = myColor;
}
}
У меня почему-то сработало .PHP:myColor = 'sw1';//в кавычки вписываешь название своего образца myTable = app.selection[0]; for(i=0;i<myTable.cells.length;i++){ if(myTable.cells[i].contents){ myTable.cells[i].fillColor=myColor; myTable.cells[i].bottomEdgeStrokeColor = myColor; myTable.cells[i].leftEdgeStrokeColor = myColor; myTable.cells[i].rightEdgeStrokeColor = myColor; myTable.cells[i].topEdgeStrokeColor = myColor; } }
var w = new Window ("dialog", "Export XML", undefined, {closeButton: false});
w.alignChildren = "right";
var tpanel = w.add ("tabbedpanel");
tpanel.alignChildren = ["fill", "fill"];
tpanel.preferredSize = [350,300];
var general = tpanel.add ("tab", undefined, "General");
general.alignChildren = "fill";
var g_options = general.add ("panel", undefined, "Options");
g_options.alignChildren = "left";
g_options.dtd_decl = g_options.add ("checkbox", undefined, "Include DTD Declaration");
g_options.view_XML = g_options.add ("checkbox", undefined, "View XML Using: ");
g_options.export_sel = g_options.add ("checkbox", undefined, "Export From Selected Element");
g_options.export_untagged = g_options.add ("checkbox", undefined, "Export Untagged Tables as CALS XML");
g_options.remap = g_options.add ("checkbox", undefined, "Remap Break, Whitespace, and Special Characters");
g_options.xslt = g_options.add ("checkbox", undefined, "Apply XSLT: ");
g_options.add ("statictext", undefined, "Encoding: ");
var images = tpanel.add ("tab", undefined, "Images");
images.alignChildren = "fill";
var img_options = images.add ("panel", undefined, "Image Options");
var buttons = w.add ("group");
buttons.add ("button", undefined, "Export", {name: "ok"});
buttons.add ("button", undefined, "Cancel");
w.show ();
#target "InDesign"
with (app) {
scriptPreferences.version = 6;
try {
var myDoc = activeDocument;
} catch (error) {
exit();
}
for (var i=0; i < myDoc.rectangles.length; i++) {
if (myDoc.rectangles[i].contentType == ContentType.GRAPHIC_TYPE && myDoc.rectangles[i].allGraphics.length > 0 && myDoc.rectangles[i].allGraphics[0].constructor.name == 'Image') {
with (myDoc.rectangles[i]) {
fillColor = myDoc.swatches.itemByName('Paper');
strokeColor = myDoc.swatches.itemByName('Paper');
strokeWeight = '0.5pt';
strokeTint = 100;
strokeAlignment = StrokeAlignment.OUTSIDE_ALIGNMENT;
textWrapPreferences.textWrapMode = TextWrapModes.BOUNDING_BOX_TEXT_WRAP;
textWrapPreferences.textWrapOffset = [0,0,0,0]
}
}
};
alert('ALL DONE!')
}
Конструкция myDoc.rectangles.allGraphics[0].constructor.name == 'Image' "подхватит" только TIFF, JPEG и GIF. Если у Вас EPS, PDF, AI, PSD и т.д. — не сработает (по крайней мере, не должно сработать).