illustrator是矢量编辑软件,画板是绘制处理的重要容器,在印刷方面的一个重要功能就是画刀版,开发一个画刀版功能,以下功能仅用于学习交流,请勿用于非法用途和商业用途,源代码如下所示:
var docRef = app.activeDocument;
var pointTomm = 2.834645;
var pw = 0;
var ph = 0;
var x = 0;
var y = 0;
var sl = false;
var aiver = app.version;
var fileNameLocation = 0;
var pageNumberLocation = 0;
var regColorIndex = 1;
var myDialog = new Window("dialog", "增加盒型对话框窗口");
with(myDialog) {
alignChildren = "fill";
margins = [16, 8, 16, 8];
spacing = 4;
var myGuideTypesPanel = add("panel", undefined, "选择一种盒型选框");
with(myGuideTypesPanel) {
orientation = "column";
alignChildren = "left";
margins = [12, 8, 12, 5];
spacing = 5;
myDialog.box1RadioButton = add("radiobutton", undefined, "直线盒");
myDialog.box1RadioButton.value = true;
myDialog.box2RadioButton = add("radiobutton", undefined, "自锁底盒");
myDialog.box2RadioButton.value = false;
myDialog.box3RadioButton = add("radiobutton", undefined, "手提袋");
myDialog.box3RadioButton.value = false;
myDialog.box4RadioButton = add("radiobutton", undefined, "手提盒");
myDialog.box4RadioButton.value = false;
myDialog.box5RadioButton = add("radiobutton", undefined, "吊挂盒");
myDialog.box5RadioButton.value = false;
myDialog.box6SelectionRadioButton = add("radiobutton", undefined, "自定");
}
with(add("group")) {
orientation = "row";
alignChildren = "center";
myDialog.dateCheckbox = add("statictext", undefined, "纸张厚度:mm");
myDialog.dateCheckbox.value = true;
add("statictext", undefined, " ");
myDialog.myNameEdittext = add("edittext", [3, 0, 36, 18], "0.5");
}
with(add("group")) {
orientation = "row";
alignChildren = "center";
myDialog.dateCheckbox = add("statictext", undefined, "粘口宽度:mm");
myDialog.dateCheckbox.value = true;
add("statictext", undefined, " ");
myDialog.myWinEdittext = add("edittext", [3, 0, 36, 18], "12");
}
with(add("group")) {
orientation = "row";
alignChildren = "center";
myDialog.dateCheckbox = add("statictext", undefined, "直线盒插舌宽度:mm");
myDialog.dateCheckbox.value = true;
add("statictext", undefined, " ");
myDialog.myWin2Edittext = add("edittext", [3, 0, 36, 18], "12");
}
var myBorderPanel = add("panel", undefined, "输入尺寸:");
with(myBorderPanel) {
with(add("group")) {
orientation = "row";
alignChildren = "center";
margins = [12, 3, 12, 0];
spacing = 6;
with(add("group")) {
orientation = "column";
alignChildren = "right";
spacing = 15;
var mylineOffsetLabel = add("statictext", undefined, "长度:");
var myWideOffsetLabel = add("statictext", undefined, "宽度:");
var myHideLabel = add("statictext", undefined, "高度:");
}
with(add("group")) {
orientation = "column";
alignChildren = "left";
characters = "40";
myDialog.mylineEdittext = add("edittext", [3, 0, 48, 18], "80.0");
myDialog.myWideEdittext = add("edittext", [3, 0, 48, 18], "50.0");
myDialog.myHideEdittext = add("edittext", [3, 0, 48, 18], "60.0");
}
with(add("group")) {
orientation = "column";
alignChildren = "left";
spacing = 15;
add("statictext", undefined, "mm");
add("statictext", undefined, "mm");
add("statictext", undefined, "mm");
}
}
}
with(add("group")) {
orientation = "row";
alignChildren = "center";
margins = [8, 0, 8, 0];
add("statictext", undefined, "");
}
with(add("group")) {
orientation = "row";
alignment = "center";
margins = [8, 0, 8, 0];
spacing = 8;
myDialog.myCloseButton = add("button", undefined, "取消", {
name: "cancel"
});
myDialog.myCloseButton.onClick = function() {
myDialog.close();
};
myDialog.myOKButton = add("button", undefined, "绘图", {
name: "ok"
});
}
}
var myReturn = myDialog.show();
if (myReturn == true) {
var sw = 0.1 * pointTomm;
var colorNameSize = 10;
var colorBarSize = 7 * pointTomm;
var lineP = myDialog.myNameEdittext.text * pointTomm;
var win = myDialog.myWinEdittext.text * pointTomm;
var win2 = myDialog.myWin2Edittext.text * pointTomm;
var creatCropMarkLayer = true;
var line = myDialog.mylineEdittext.text * pointTomm;
var wide = myDialog.myWideEdittext.text * pointTomm;
var hide = myDialog.myHideEdittext.text * pointTomm;
var box = myDialog.box1RadioButton.value;
var boxtwo = myDialog.box2RadioButton.value;
var boxthree = myDialog.box3RadioButton.value;
var boxfour = myDialog.box4RadioButton.value;
var boxfive = myDialog.box5RadioButton.value;
var boxsix = myDialog.box6SelectionRadioButton.value;
if (creatCropMarkLayer == true) {
app.activeDocument.layers.add();
activeDocument.layers[0].name = "模切";
}
var zeroX = x;
var zeroY = y;
newCMYKColor = new CMYKColor();
newCMYKColor.cyan = 0;
newCMYKColor.magenta = 0;
newCMYKColor.yellow = 0;
newCMYKColor.black = 100;
docRef.selection = null;
docRef.defaultFilled = false;
docRef.defaultStroked = true;
docRef.defaultStrokeWidth = sw;
docRef.defaultStrokeColor = newCMYKColor;
if (box == true) {
boxBar();
}
if (boxtwo == true) {
boxtwoBar();
}
if (boxthree == true) {
boxthreeBar();
}
if (boxfour == true) {
boxfourBar();
}
if (boxfive == true) {
boxfiveBar();
}
if (boxsix == true) {
boxsixBar();
}
}
function boxBar() {
if (sl == true) {
var w1 = sw / 2;
w2 = w + lineP;
} else {
var w1 = sw / 2;
w2 = wide;
}
var moBarGroup = app.activeDocument.groupItems.add();
var lineGroup = docRef.groupItems.add();
var lineGroup2 = docRef.groupItems.add();
var lineGroup3 = docRef.groupItems.add();
var lineGroup4 = docRef.groupItems.add();
var lineGroup5 = docRef.groupItems.add();
var lineGroup6 = docRef.groupItems.add();
var lineGroup7 = docRef.groupItems.add();
var mline1 = moBarGroup.pathItems.add();
mline1.setEntirePath(Array(Array(x, y), Array(x, hide + lineP)));
mline1.filled = false;
var mline11 = mline1.duplicate();
mline11.translate(line, 0);
var mline12 = mline1.duplicate();
mline12.translate(line + wide, 0 - lineP);
var mline13 = mline1.duplicate();
mline13.translate((2 * line) + wide, 0 - lineP);
var mline14 = mline1.duplicate();
mline14.translate(((2 * line) + (2 * wide)) - lineP, 0 - lineP);
var mline2 = lineGroup.pathItems.add();
mline2.setEntirePath(Array(Array(x, y), Array(line, y)));
mline2.filled = false;
var mline21 = mline2.duplicate();
mline21.translate(0, hide + lineP);
var mline22 = mline2.duplicate();
mline22.translate(0, hide + wide + lineP);
lineGroup2 = lineGroup.duplicate();
lineGroup2.rotate(180);
lineGroup2.translate(x + line + wide, (y - wide) - lineP);
var mline3 = lineGroup3.pathItems.add();
mline3.setEntirePath(Array(Array(x, y + hide + lineP), Array(x, y + hide + wide + lineP)));
var mline32 = mline3.duplicate();
mline32.translate(line, 0);
var mline33 = mline3.duplicate();
mline33.translate(line + wide, (-hide - wide) - (2 * lineP));
var mline34 = mline3.duplicate();
mline34.translate((2 * line) + wide, (-hide - wide) - (2 * lineP));
var mline4 = lineGroup4.pathItems.add();
mline4.setEntirePath(Array(Array((x + line + wide) - lineP, y + hide), Array((x + line + wide) - lineP, y + hide + (5 * pointTomm)), Array((x + line + wide) - (3 * pointTomm), y + hide + (8 * pointTomm)), Array((x + line + wide) - (6 * pointTomm), y + hide + ((2 * wide) / 3))));
var mline41 = lineGroup4.pathItems.add();
mline41.setEntirePath(Array(Array((x + line + wide) - (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array(x + line + (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array(x + line, y + hide), Array(x + line + wide, y + hide)));
lineGroup5 = lineGroup4.duplicate();
lineGroup5.left = (x + line) - w1;
lineGroup5.top = y + w1;
lineGroup5.rotate(180);
var mline5 = lineGroup6.pathItems.add();
mline5.setEntirePath(Array(Array(x + (2 * line) + wide + lineP, y + hide), Array(x + (2 * line) + wide + lineP, y + hide + (5 * pointTomm)), Array(x + (2 * line) + wide + (3 * pointTomm), y + hide + (8 * pointTomm)), Array(x + (2 * line) + wide + (6 * pointTomm), y + hide + ((2 * wide) / 3))));
var mline51 = lineGroup6.pathItems.add();
mline51.setEntirePath(Array(Array(x + (2 * line) + wide + (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array((x + (2 * line) + (2 * wide)) - (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array((x + (2 * line) + (2 * wide)) - lineP, y + hide), Array(x + (2 * line) + wide, y + hide)));
var mline52 = lineGroup6.pathItems.add();
mline52.setEntirePath(Array(Array((x + (2 * line) + (2 * wide)) - lineP, y), Array((x + (2 * line) + (2 * wide)) - lineP, y - (5 * pointTomm)), Array((x + (2 * line) + (2 * wide)) - (3 * pointTomm), y - (8 * pointTomm)), Array((x + (2 * line) + (2 * wide)) - (6 * pointTomm), y - ((2 * wide) / 3))));
var mline53 = lineGroup6.pathItems.add();
mline53.setEntirePath(Array(Array((x + (2 * line) + (2 * wide)) - (6 * pointTomm), y - ((2 * wide) / 3)), Array(x + (2 * line) + wide + (6 * pointTomm), y - ((2 * wide) / 3)), Array(x + (2 * line) + wide, y), Array((x + (2 * line) + (2 * wide) + w1) - lineP, y)));
var mline7 = lineGroup7.pathItems.add();
mline7.setEntirePath(Array(Array(x, y), Array(x - win, y + (win * 0.27)), Array(x - win, (hide + lineP) - (win * 0.27)), Array(x, y + hide + lineP)));
var regGroup = app.activeDocument.groupItems.add();
var reg11 = regGroup.pathItems.add();
reg11.setEntirePath([
[lineP, hide + wide + lineP],
[lineP, (hide + wide + lineP + win2) - (2 * pointTomm)],
[lineP + (2 * pointTomm), hide + wide + lineP + win2],
[(line - lineP) - (2 * pointTomm), hide + wide + lineP + win2],
[line - lineP, (hide + wide + lineP + win2) - (2 * pointTomm)],
[line - lineP, hide + wide + lineP]
]);
var regGroup1 = app.activeDocument.groupItems.add();
regGroup1 = regGroup.duplicate();
regGroup1.left = ((x + line + wide) - w1) + lineP;
regGroup1.top = ((y - wide) - lineP) + w1;
regGroup1.rotate(180);
}
function boxtwoBar() {
if (sl == true) {
var w1 = sw / 2;
w2 = w + lineP;
} else {
var w1 = sw / 2;
w2 = wide;
}
var lineGroup = docRef.groupItems.add();
var lineGroup2 = docRef.groupItems.add();
var lineGroup3 = docRef.groupItems.add();
var lineGroup4 = docRef.groupItems.add();
var lineGroup5 = docRef.groupItems.add();
var lineGroup6 = docRef.groupItems.add();
var lineGroup7 = docRef.groupItems.add();
var mline1 = lineGroup.pathItems.add();
mline1.setEntirePath([
[x, y],
[x, hide + lineP],
[line, hide + lineP],
[line, y],
[line + wide, y],
[line + wide, hide],
[line, hide]
]);
mline1.filled = false;
mline1.StrokeColor = newCMYKColor;
var mline11 = lineGroup.pathItems.add();
mline11.setEntirePath([
[line + wide, y],
[(2 * line) + wide, y],
[(2 * line) + wide, hide],
[((2 * line) + (2 * wide)) - lineP, hide]
]);
var mline12 = lineGroup.pathItems.add();
mline12.setEntirePath([
[(2 * line) + wide, y],
[((2 * line) + (2 * wide)) - lineP, y]
]);
var mline2 = lineGroup2.pathItems.add();
mline2.setEntirePath([
[x, y + hide + lineP],
[x, y + hide + wide + lineP],
[line, y + hide + wide + lineP],
[line, y + hide + lineP]
]);
var mline21 = lineGroup2.pathItems.add();
mline21.setEntirePath([
[lineP, hide + wide + lineP],
[lineP, (hide + wide + lineP + win2) - (2 * pointTomm)],
[lineP + (2 * pointTomm), hide + wide + lineP + win2],
[(line - lineP) - (2 * pointTomm), hide + wide + lineP + win2],
[line - lineP, (hide + wide + lineP + win2) - (2 * pointTomm)],
[line - lineP, hide + wide + lineP]
]);
var mline3 = lineGroup3.pathItems.add();
mline3.setEntirePath([
[line + wide, hide],
[(2 * line) + wide, hide]
]);
var mline31 = lineGroup3.pathItems.add();
mline31.setEntirePath([
[((2 * line) + (2 * wide)) - lineP, y],
[((2 * line) + (2 * wide)) - lineP, hide]
]);
var mline32 = lineGroup3.pathItems.add();
mline32.setEntirePath([
[x, y],
[line, y]
]);
var mline4 = lineGroup4.pathItems.add();
mline4.setEntirePath(Array(Array((x + line + wide) - lineP, y + hide), Array((x + line + wide) - lineP, y + hide + (5 * pointTomm)), Array((x + line + wide) - (3 * pointTomm), y + hide + (8 * pointTomm)), Array((x + line + wide) - (6 * pointTomm), y + hide + ((2 * wide) / 3))));
var mline41 = lineGroup4.pathItems.add();
mline41.setEntirePath(Array(Array((x + line + wide) - (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array(x + line + (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array(x + line, y + hide), Array(x + line + wide, y + hide)));
var mline5 = lineGroup5.pathItems.add();
mline5.setEntirePath(Array(Array(x + (2 * line) + wide + lineP, y + hide), Array(x + (2 * line) + wide + lineP, y + hide + (5 * pointTomm)), Array(x + (2 * line) + wide + (3 * pointTomm), y + hide + (8 * pointTomm)), Array(x + (2 * line) + wide + (6 * pointTomm), y + hide + ((2 * wide) / 3))));
var mline51 = lineGroup5.pathItems.add();
mline51.setEntirePath(Array(Array(x + (2 * line) + wide + (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array((x + (2 * line) + (2 * wide)) - (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array((x + (2 * line) + (2 * wide)) - lineP, y + hide), Array(x + (2 * line) + wide, y + hide)));
var mline6 = lineGroup6.pathItems.add();
mline6.setEntirePath([
[x, y],
[(line / 4) + lineP, y - (wide / 2)],
[(line / 4) + lineP, y - ((3 * wide) / 4)],
[((3 * line) / 4) - lineP, y - ((3 * wide) / 4)],
[((3 * line) / 4) - lineP, y - (wide / 2)],
[line, y]
]);
var mline61 = lineGroup6.pathItems.add();
mline61.setEntirePath([
[line, y],
[line + lineP, y - ((3 * wide) / 4)],
[line + (wide / 2), y - ((3 * wide) / 4)],
[line + (wide / 2), y - (wide / 2)],
[line + wide, y]
]);
var mline62 = lineGroup6.pathItems.add();
mline62.setEntirePath([
[line + wide, y],
[line + wide + lineP, y - ((3 * wide) / 4)],
[((5 * line) / 4) + wide, y - ((3 * wide) / 4)],
[((5 * line) / 4) + wide, y - (wide / 2)],
[((7 * line) / 4) + wide, y - (wide / 2)],
[((7 * line) / 4) + wide, y - ((3 * wide) / 4)],
[((2 * line) + wide) - lineP, y - ((3 * wide) / 4)],
[(2 * line) + wide, y]
]);
var mline63 = lineGroup6.pathItems.add();
mline63.setEntirePath([
[(2 * line) + wide, y],
[(2 * line) + ((3 * wide) / 2) + lineP, y - (wide / 2)],
[(2 * line) + ((3 * wide) / 2) + lineP, y - ((3 * wide) / 4)],
[((2 * line) + (2 * wide)) - lineP, y - ((3 * wide) / 4)],
[((2 * line) + (2 * wide)) - lineP, y]
]);
var mline7 = lineGroup7.pathItems.add();
mline7.setEntirePath(Array(Array(x, y), Array(x - win, y + (win * 0.27)), Array(x - win, (hide + lineP) - (win * 0.27)), Array(x, y + hide + lineP)));
}
function boxthreeBar() {
if (sl == true) {
var w1 = sw / 2;
w2 = w + lineP;
} else {
var w1 = sw / 2;
w2 = wide;
}
var lineGroup = docRef.groupItems.add();
var lineGroup2 = docRef.groupItems.add();
var lineGroup3 = docRef.groupItems.add();
var lineGroup4 = docRef.groupItems.add();
var lineGroup5 = docRef.groupItems.add();
var lineGroup6 = docRef.groupItems.add();
var lineGroup7 = docRef.groupItems.add();
var mline1 = lineGroup.pathItems.add();
mline1.setEntirePath([
[x, y],
[x, hide],
[line, hide],
[line, y],
[line + wide, y],
[line + wide, hide],
[line, hide]
]);
mline1.filled = false;
mline1.StrokeColor = newCMYKColor;
var mline11 = lineGroup.pathItems.add();
mline11.setEntirePath([
[line + wide, y],
[(2 * line) + wide, y],
[(2 * line) + wide, hide],
[((2 * line) + (2 * wide)) - lineP, hide]
]);
var mline12 = lineGroup.pathItems.add();
mline12.setEntirePath([
[(2 * line) + wide, y],
[((2 * line) + (2 * wide)) - lineP, y]
]);
var mline3 = lineGroup3.pathItems.add();
mline3.setEntirePath([
[line + wide, hide],
[(2 * line) + wide, hide]
]);
var mline31 = lineGroup3.pathItems.add();
mline31.setEntirePath([
[((2 * line) + (2 * wide)) - lineP, y],
[((2 * line) + (2 * wide)) - lineP, hide]
]);
var mline32 = lineGroup3.pathItems.add();
mline32.setEntirePath([
[x, y],
[line, y]
]);
var mline4 = lineGroup4.pathItems.add();
mline4.setEntirePath([
[x, y],
[x, y - ((2 * wide) / 3)]
]);
var mline41 = lineGroup4.pathItems.add();
mline41.setEntirePath([
[line, y],
[line, y - ((2 * wide) / 3)]
]);
var mline42 = lineGroup4.pathItems.add();
mline42.setEntirePath([
[line + wide, y],
[line + wide, y - ((2 * wide) / 3)]
]);
var mline43 = lineGroup4.pathItems.add();
mline43.setEntirePath([
[(2 * line) + wide, y],
[(2 * line) + wide, y - ((2 * wide) / 3)]
]);
var mline44 = lineGroup4.pathItems.add();
mline44.setEntirePath([
[line / 2, y],
[line / 2, hide]
]);
var mline45 = lineGroup4.pathItems.add();
mline45.setEntirePath([
[(2 * line) + ((3 * wide) / 2), y],
[(2 * line) + ((3 * wide) / 2), hide]
]);
var mline6 = lineGroup6.pathItems.add();
mline6.setEntirePath([
[x - win, y],
[x - win, y - ((2 * wide) / 3)],
[((2 * line) + (2 * wide)) - lineP, y - ((2 * wide) / 3)],
[((2 * line) + (2 * wide)) - lineP, y]
]);
var mline61 = lineGroup6.pathItems.add();
mline61.setEntirePath([
[x - win, y - win],
[x, y],
[(2 * wide) / 3, y - ((2 * wide) / 3)]
]);
var mline62 = lineGroup6.pathItems.add();
mline62.setEntirePath([
[line - ((2 * wide) / 3), y - ((2 * wide) / 3)],
[line, y],
[line + ((2 * wide) / 3), y - ((2 * wide) / 3)]
]);
var mline63 = lineGroup6.pathItems.add();
mline63.setEntirePath([
[line + (wide / 3), y - ((2 * wide) / 3)],
[line + wide, y],
[line + ((5 * wide) / 3), y - ((2 * wide) / 3)]
]);
var mline64 = lineGroup6.pathItems.add();
mline64.setEntirePath([
[(2 * line) + (wide / 3), y - ((2 * wide) / 3)],
[(2 * line) + wide, y],
[(2 * line) + ((5 * wide) / 3), y - ((2 * wide) / 3)]
]);
var mline65 = lineGroup6.pathItems.add();
mline65.setEntirePath([
[(2 * line) + ((4 * wide) / 3), y - ((2 * wide) / 3)],
[((2 * line) + (2 * wide)) - lineP, y]
]);
var mline7 = lineGroup7.pathItems.add();
mline7.setEntirePath(Array(Array(x, y), Array(x - win, y), Array(x - win, hide - (win * 0.27)), Array(x, y + hide)));
}
function boxfourBar() {
if (sl == true) {
var w1 = sw / 2;
w2 = w + lineP;
} else {
var w1 = sw / 2;
w2 = wide;
}
var lineGroup = docRef.groupItems.add();
var lineGroup2 = docRef.groupItems.add();
var lineGroup3 = docRef.groupItems.add();
var lineGroup4 = docRef.groupItems.add();
var lineGroup5 = docRef.groupItems.add();
var lineGroup6 = docRef.groupItems.add();
var lineGroup7 = docRef.groupItems.add();
var mline1 = lineGroup.pathItems.add();
mline1.setEntirePath([
[x, y],
[x, hide + lineP],
[line, hide + lineP],
[line, y],
[line + wide, y],
[line + wide, hide],
[line, hide]
]);
mline1.filled = false;
mline1.StrokeColor = newCMYKColor;
var mline11 = lineGroup.pathItems.add();
mline11.setEntirePath([
[line + wide, y],
[(2 * line) + wide, y],
[(2 * line) + wide, hide],
[((2 * line) + (2 * wide)) - lineP, hide]
]);
var mline12 = lineGroup.pathItems.add();
mline12.setEntirePath([
[(2 * line) + wide, y],
[((2 * line) + (2 * wide)) - lineP, y]
]);
var mline2 = lineGroup2.pathItems.add();
mline2.setEntirePath([
[line, y + hide + lineP],
[line + (0.1 * wide), y + hide + ((3 * wide) / 4)],
[(line + wide) - (0.1 * wide), y + hide + ((3 * wide) / 4)],
[line + wide, y + hide]
]);
var mline21 = lineGroup2.pathItems.add();
mline21.setEntirePath([
[x, hide + lineP],
[x, hide + wide + lineP],
[x + (line / 13), hide + wide + lineP],
[x + (line / 10), (hide + wide + lineP) - (wide / 12)],
[x + (line / 8), hide + wide + lineP],
[line - (line / 8), hide + wide + lineP]
]);
var mline22 = lineGroup2.pathItems.add();
mline22.setEntirePath([
[line - (line / 8), hide + wide + lineP],
[line - (line / 10), (hide + wide + lineP) - (wide / 12)],
[line - (line / 13), hide + wide + lineP],
[line, hide + wide + lineP],
[line, hide]
]);
var mline23 = lineGroup2.pathItems.add();
mline23.setEntirePath([
[line + wide, hide],
[line + wide, hide + wide + lineP],
[line + wide + (line / 13), hide + wide + lineP],
[line + wide + (line / 10), (hide + wide + lineP) - (wide / 12)],
[line + wide + (line / 8), hide + wide + lineP],
[((2 * line) + wide) - (line / 8), hide + wide + lineP]
]);
var mline24 = lineGroup2.pathItems.add();
mline24.setEntirePath([
[((2 * line) + wide) - (line / 8), hide + wide + lineP],
[((2 * line) + wide) - (line / 10), (hide + wide + lineP) - (wide / 12)],
[((2 * line) + wide) - (line / 13), hide + wide + lineP],
[(2 * line) + wide, hide + wide + lineP],
[(2 * line) + wide, hide]
]);
var mline25 = lineGroup2.pathItems.add();
mline25.setEntirePath([
[(2 * line) + wide, y + hide],
[(2 * line) + wide + (0.1 * wide), y + hide + ((3 * wide) / 4)],
[(((2 * line) + (2 * wide)) - (0.1 * wide)) - lineP, y + hide + ((3 * wide) / 4)],
[((2 * line) + (2 * wide)) - lineP, y + hide]
]);
var mline26 = lineGroup2.pathItems.add();
mline26.setEntirePath([
[x, (hide + (wide / 2)) - lineP],
[line, (hide + (wide / 2)) - lineP]
]);
var mline27 = lineGroup2.pathItems.add();
mline27.setEntirePath([
[line + wide, (hide + (wide / 2)) - lineP],
[(2 * line) + wide, (hide + (wide / 2)) - lineP]
]);
var mline3 = lineGroup3.pathItems.add();
mline3.setEntirePath([
[line + wide, hide],
[(2 * line) + wide, hide]
]);
var mline31 = lineGroup3.pathItems.add();
mline31.setEntirePath([
[((2 * line) + (2 * wide)) - lineP, y],
[((2 * line) + (2 * wide)) - lineP, hide]
]);
var mline32 = lineGroup3.pathItems.add();
mline32.setEntirePath([
[x, y],
[line, y]
]);
var mline6 = lineGroup6.pathItems.add();
mline6.setEntirePath([
[x, y],
[(line / 4) + lineP, y - (wide / 2)],
[(line / 4) + lineP, y - ((3 * wide) / 4)],
[((3 * line) / 4) - lineP, y - ((3 * wide) / 4)],
[((3 * line) / 4) - lineP, y - (wide / 2)],
[line, y]
]);
var mline61 = lineGroup6.pathItems.add();
mline61.setEntirePath([
[line, y],
[line + lineP, y - ((3 * wide) / 4)],
[line + (wide / 2), y - ((3 * wide) / 4)],
[line + (wide / 2), y - (wide / 2)],
[line + wide, y]
]);
var mline62 = lineGroup6.pathItems.add();
mline62.setEntirePath([
[line + wide, y],
[line + wide + lineP, y - ((3 * wide) / 4)],
[((5 * line) / 4) + wide, y - ((3 * wide) / 4)],
[((5 * line) / 4) + wide, y - (wide / 2)],
[((7 * line) / 4) + wide, y - (wide / 2)],
[((7 * line) / 4) + wide, y - ((3 * wide) / 4)],
[((2 * line) + wide) - lineP, y - ((3 * wide) / 4)],
[(2 * line) + wide, y]
]);
var mline63 = lineGroup6.pathItems.add();
mline63.setEntirePath([
[(2 * line) + wide, y],
[(2 * line) + ((3 * wide) / 2) + lineP, y - (wide / 2)],
[(2 * line) + ((3 * wide) / 2) + lineP, y - ((3 * wide) / 4)],
[((2 * line) + (2 * wide)) - lineP, y - ((3 * wide) / 4)],
[((2 * line) + (2 * wide)) - lineP, y]
]);
var mline7 = lineGroup7.pathItems.add();
mline7.setEntirePath(Array(Array(x, y), Array(x - win, y + (win * 0.27)), Array(x - win, (hide + lineP) - (win * 0.27)), Array(x, y + hide + lineP)));
var regGroup = app.activeDocument.groupItems.add();
var reg1 = regGroup.pathItems.add();
reg1 = regGroup.pathItems.roundedRectangle(hide + (wide / 2), (line + (wide / 2)) - ((3 * lineP) / 2), 3 * lineP, wide / 2);
var reg11 = regGroup.pathItems.add();
reg1 = regGroup.pathItems.roundedRectangle(hide + (wide / 2), ((2 * line) + ((3 * wide) / 2)) - ((3 * lineP) / 2), 3 * lineP, wide / 2);
var reg12 = regGroup.pathItems.add();
reg12 = regGroup.pathItems.roundedRectangle(hide + ((7 * wide) / 8), line / 6, (2 * line) / 3, wide / 4);
var reg13 = regGroup.pathItems.add();
reg13 = regGroup.pathItems.roundedRectangle(hide + ((7 * wide) / 8), ((7 * line) / 6) + wide, (2 * line) / 3, wide / 4);
}
function boxfiveBar() {
if (sl == true) {
var w1 = sw / 2;
w2 = w + lineP;
} else {
var w1 = sw / 2;
w2 = wide;
}
var lineGroup = docRef.groupItems.add();
var lineGroup2 = docRef.groupItems.add();
var lineGroup3 = docRef.groupItems.add();
var lineGroup4 = docRef.groupItems.add();
var lineGroup5 = docRef.groupItems.add();
var lineGroup6 = docRef.groupItems.add();
var lineGroup7 = docRef.groupItems.add();
var mline1 = lineGroup.pathItems.add();
mline1.setEntirePath([
[x, y],
[x, hide + lineP],
[line, hide + lineP],
[line, y],
[line + wide, y],
[line + wide, hide],
[line, hide]
]);
mline1.filled = false;
mline1.StrokeColor = newCMYKColor;
var mline11 = lineGroup.pathItems.add();
mline11.setEntirePath([
[line + wide, y],
[(2 * line) + wide, y],
[(2 * line) + wide, hide],
[((2 * line) + (2 * wide)) - lineP, hide]
]);
var mline12 = lineGroup.pathItems.add();
mline12.setEntirePath([
[(2 * line) + wide, y],
[((2 * line) + (2 * wide)) - lineP, y]
]);
var mline2 = lineGroup2.pathItems.add();
mline2.setEntirePath([
[x, y + hide + lineP],
[x, y + hide + wide],
[line, y + hide + wide],
[line, y + hide + lineP]
]);
var mline21 = lineGroup2.pathItems.add();
mline21.setEntirePath([
[lineP, hide + wide],
[lineP, (hide + wide + lineP + win2) - (2 * pointTomm)],
[lineP + (2 * pointTomm), hide + wide + lineP + win2],
[(line - lineP) - (2 * pointTomm), hide + wide + lineP + win2],
[line - lineP, (hide + wide + lineP + win2) - (2 * pointTomm)],
[line - lineP, hide + wide]
]);
var mline3 = lineGroup3.pathItems.add();
mline3.setEntirePath([
[line + wide, hide],
[(2 * line) + wide, hide]
]);
var mline31 = lineGroup3.pathItems.add();
mline31.setEntirePath([
[((2 * line) + (2 * wide)) - lineP, y],
[((2 * line) + (2 * wide)) - lineP, hide]
]);
var mline32 = lineGroup3.pathItems.add();
mline32.setEntirePath([
[x, y],
[line, y]
]);
var mline4 = lineGroup4.pathItems.add();
mline4.setEntirePath(Array(Array((x + line + wide) - lineP, y + hide), Array((x + line + wide) - lineP, y + hide + (5 * pointTomm)), Array((x + line + wide) - (3 * pointTomm), y + hide + (8 * pointTomm)), Array((x + line + wide) - (6 * pointTomm), y + hide + ((2 * wide) / 3))));
var mline41 = lineGroup4.pathItems.add();
mline41.setEntirePath(Array(Array((x + line + wide) - (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array(x + line + (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array(x + line, y + hide), Array(x + line + wide, y + hide)));
var mline5 = lineGroup5.pathItems.add();
mline5.setEntirePath(Array(Array(x + (2 * line) + wide + lineP, y + hide), Array(x + (2 * line) + wide + lineP, y + hide + (5 * pointTomm)), Array(x + (2 * line) + wide + (3 * pointTomm), y + hide + (8 * pointTomm)), Array(x + (2 * line) + wide + (6 * pointTomm), y + hide + ((2 * wide) / 3))));
var mline51 = lineGroup5.pathItems.add();
mline51.setEntirePath(Array(Array(x + (2 * line) + wide + (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array((x + (2 * line) + (2 * wide)) - (6 * pointTomm), y + hide + ((2 * wide) / 3)), Array((x + (2 * line) + (2 * wide)) - lineP, y + hide), Array(x + (2 * line) + wide, y + hide)));
var mline6 = lineGroup6.pathItems.add();
mline6.setEntirePath([
[x, y],
[(line / 4) + lineP, y - (wide / 2)],
[(line / 4) + lineP, y - ((3 * wide) / 4)],
[((3 * line) / 4) - lineP, y - ((3 * wide) / 4)],
[((3 * line) / 4) - lineP, y - (wide / 2)],
[line, y]
]);
var mline61 = lineGroup6.pathItems.add();
mline61.setEntirePath([
[line, y],
[line + lineP, y - ((3 * wide) / 4)],
[line + (wide / 2), y - ((3 * wide) / 4)],
[line + (wide / 2), y - (wide / 2)],
[line + wide, y]
]);
var mline62 = lineGroup6.pathItems.add();
mline62.setEntirePath([
[line + wide, y],
[line + wide + lineP, y - ((3 * wide) / 4)],
[((5 * line) / 4) + wide, y - ((3 * wide) / 4)],
[((5 * line) / 4) + wide, y - (wide / 2)],
[((7 * line) / 4) + wide, y - (wide / 2)],
[((7 * line) / 4) + wide, y - ((3 * wide) / 4)],
[((2 * line) + wide) - lineP, y - ((3 * wide) / 4)],
[(2 * line) + wide, y]
]);
var mline63 = lineGroup6.pathItems.add();
mline63.setEntirePath([
[(2 * line) + wide, y],
[(2 * line) + ((3 * wide) / 2) + lineP, y - (wide / 2)],
[(2 * line) + ((3 * wide) / 2) + lineP, y - ((3 * wide) / 4)],
[((2 * line) + (2 * wide)) - lineP, y - ((3 * wide) / 4)],
[((2 * line) + (2 * wide)) - lineP, y]
]);
var mline7 = lineGroup7.pathItems.add();
mline7.setEntirePath(Array(Array(x, y), Array(x - win, y + (win * 0.27)), Array(x - win, (hide + lineP) - (win * 0.27)), Array(x, y + hide + lineP)));
var mline71 = lineGroup7.pathItems.add();
mline71.setEntirePath([
[line + wide, y + hide],
[line + wide, y + hide + wide],
[(2 * line) + wide, y + hide + wide],
[(2 * line) + wide, y + hide]
]);
var regGroup = app.activeDocument.groupItems.add();
var reg1 = regGroup.pathItems.add();
reg1 = regGroup.pathItems.roundedRectangle((hide + wide) - (8 * pointTomm), ((7 * line) / 6) + wide, (2 * line) / 3, 12 * pointTomm);
}
function boxsixBar() {
if (sl == true) {
var w1 = sw / 2;
w2 = w + lineP;
} else {
var w1 = sw / 2;
w2 = wide;
}
var lineGroup = docRef.groupItems.add();
var lineGroup2 = docRef.groupItems.add();
var lineGroup3 = docRef.groupItems.add();
var lineGroup4 = docRef.groupItems.add();
var lineGroup5 = docRef.groupItems.add();
var lineGroup6 = docRef.groupItems.add();
var lineGroup7 = docRef.groupItems.add();
var mline1 = lineGroup.pathItems.add();
mline1.setEntirePath([
[x, y],
[x, hide + lineP],
[line, hide + lineP],
[line, y],
[line + wide, y],
[line + wide, hide],
[line, hide]
]);
mline1.filled = false;
mline1.StrokeColor = newCMYKColor;
var mline11 = lineGroup.pathItems.add();
mline11.setEntirePath([
[line + wide, y - lineP],
[(2 * line) + wide, y - lineP],
[(2 * line) + wide, hide],
[((2 * line) + (2 * wide)) - lineP, hide]
]);
var mline12 = lineGroup.pathItems.add();
mline12.setEntirePath([
[(2 * line) + wide, y],
[((2 * line) + (2 * wide)) - lineP, y]
]);
var mline2 = lineGroup2.pathItems.add();
mline2.setEntirePath([
[x, y + hide + lineP],
[x, y + hide + wide + lineP],
[line, y + hide + wide + lineP],
[line, y + hide + lineP]
]);
var mline21 = lineGroup2.pathItems.add();
mline21.setEntirePath([
[lineP, hide + wide + lineP],
[lineP, (hide + wide + lineP + win2) - (2 * pointTomm)],
[lineP + (2 * pointTomm), hide + wide + lineP + win2],
[(line - lineP) - (2 * pointTomm), hide + wide + lineP + win2],
[line - lineP, (hide + wide + lineP + win2) - (2 * pointTomm)],
[line - lineP, hide + wide + lineP]
]);
var mline3 = lineGroup3.pathItems.add();
mline3.setEntirePath([
[line + wide, hide],
[(2 * line) + wide, hide]
]);
var mline31 = lineGroup3.pathItems.add();
mline31.setEntirePath([
[((2 * line) + (2 * wide)) - lineP, y],
[((2 * line) + (2 * wide)) - lineP, hide]
]);
var mline32 = lineGroup3.pathItems.add();
mline32.setEntirePath([
[x, y],
[line, y]
]);
var mline7 = lineGroup7.pathItems.add();
mline7.setEntirePath(Array(Array(x, y), Array(x - win, y + (win * 0.27)), Array(x - win, (hide + lineP) - (win * 0.27)), Array(x, y + hide + lineP)));
}
myDialog.close();
合理的脚本代码可以有效的提高工作效率,减少重复劳动。
文章引用至 作者知了-联系方式1
文章引用至 作者知了-联系方式2