文章目录
1.算法程序
- 1.算法程序
- 2.作者答疑
illustrator是矢量编辑软件,在印刷方面的一个重要功能就是拼版,开发一个印前角线功能,源代码如下所示:
Ver = "v7.3";
var platFormType = Folder.fs;
if (platFormType == "Windows") {
gArgG = decodeURI(new File($.fileName).path) + "/AutoMark_" + Ver + ".xml";
} else {
gArgG = Folder.myDocuments + "/AutoMark_" + Ver + ".xml";
}
function function1 () {NewFileVal = new File(gArgG);
if (NewFileVal.exists == false) {function2 ();
}
AutoMarkinfo = function3 ("read", gArgG);
AutoMarkXml = new XML(AutoMarkinfo);
regWin = new Window("dialog", "角线X " + Ver + " tiandiyiqi 89766284", [0, 0, 475, 385], {
resizeable: true,
resizeable: false
});
caiqiezu = regWin.add("group", [0, 0, 390, 122], "undefined");
caiqiexian = caiqiezu.add("panel", [12, 8, 387, 116], "裁切线");
lineLengh = caiqiezu.add("statictext", [24, 37, 94, 57], "长度:");
linewide = caiqiezu.add("statictext", [24, 64, 94, 84], "宽度:");
outSpace = caiqiezu.add("statictext", [155, 34, 225, 54], "出血:");
lineSpace = caiqiezu.add("statictext", [155, 61, 225, 81], "偏移:");
lLValue = caiqiezu.add("edittext", [58, 34, 138, 54], AutoMarkXml.lLValue);
lwValue = caiqiezu.add("edittext", [58, 60, 138, 80], AutoMarkXml.lwValue);
lSValue = caiqiezu.add("edittext", [186, 60, 266, 80], AutoMarkXml.lSValue);
oSValue = caiqiezu.add("edittext", [186, 34, 266, 54], AutoMarkXml.oSValue);
doubleLine = caiqiezu.add("checkbox", [312, 33, 382, 53], "双角线");
doubleLine.value = AutoMarkXml.doubleLine - 0;
JPLine = caiqiezu.add("checkbox", [312, 61, 382, 81], "日式角线");
JPLine.value = AutoMarkXml.JPLine - 0;
havebleed = caiqiezu.add("statictext", [25, 93, 95, 113], "模式:");
buhanchuxue = caiqiezu.add("radiobutton", [74, 90, 164, 110], "不含出血");
buhanchuxue.value = AutoMarkXml.buhanchuxue - 0;
quanbuchuxue = caiqiezu.add("radiobutton", [195, 90, 285, 110], "全部出血");
quanbuchuxue.value = AutoMarkXml.quanbuchuxue - 0;
dabanchuxue = caiqiezu.add("radiobutton", [312, 90, 402, 110], "大版出血");
dabanchuxue.value = AutoMarkXml.dabanchuxue - 0;
yansezu = regWin.add("group", [0, 120, 230, 215], "undefined");
yansexian = yansezu.add("panel", [12, 0, 225, 92], "颜 色");
CMYK = yansexian.add("radiobutton", [12, 11, 102, 31], "英文");
CMYK.value = AutoMarkXml.CMYK - 0;
mingcheng = yansexian.add("radiobutton", [58, 11, 156, 31], "中英文");
mingcheng.value = AutoMarkXml.mingcheng - 0;
wu = yansexian.add("radiobutton", [118, 11, 205, 31], "无");
wu.value = AutoMarkXml.wu - 0;
boolCx = yansexian.add("checkbox", [13, 33, 83, 53], "C");
boolCx.value = AutoMarkXml.boolCx - 0;
boolMx = yansexian.add("checkbox", [65, 33, 137, 53], "M");
boolMx.value = AutoMarkXml.boolMx - 0;
boolYx = yansexian.add("checkbox", [115, 33, 185, 53], "Y");
boolYx.value = AutoMarkXml.boolYx - 0;
boolKx = yansexian.add("checkbox", [159, 33, 229, 53], "K");
boolKx.value = AutoMarkXml.boolKx - 0;
colorLable = yansexian.add("checkbox", [159, 10, 229, 30], "色条");
colorLable.value = AutoMarkXml.colorLable - 0;
ptReplace = yansexian.add("statictext", [10, 59, 110, 79], "Pantone代替:", {
multiline: true
});
prValue = yansexian.add("edittext", [95, 57, 198, 73], AutoMarkXml.prValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
CMYK.onClick = mingcheng.onClick = function() {
if (CMYK.value == true || mingcheng.value == true) {
boolCx.value = true;
boolMx.value = true;
boolYx.value = true;
boolKx.value = true;
}
};
wu.onClick = function() {
if (wu.value == true) {
CMYK.value = false;
mingcheng.value = false;
boolCx.value = false;
boolMx.value = false;
boolYx.value = false;
boolKx.value = false;
colorLable.value = false;
}
};
boolCx.onClick = boolMx.onClick = boolYx.onClick = boolKx.onClick = function() {
if (boolCx.value == false && boolMx.value == false && boolYx.value == false && boolKx.value == false) {
wu.value = true;
}
if (boolCx.value == true && boolMx.value == true && boolYx.value == true && boolKx.value == true) {
CMYK.value = true;
}
};
xinxizu = regWin.add("group", [230, 120, 390, 258], "undefined");
xinxixian = xinxizu.add("panel", [0, 0, 157, 123], "信息");
haveFN = xinxizu.add("checkbox", [11, 18, 81, 38], "文件名");
haveFN.value = AutoMarkXml.haveFN - 0;
haveTM = xinxizu.add("checkbox", [11, 43, 81, 63], "日期");
haveTM.value = AutoMarkXml.haveTM - 0;
havePT = xinxizu.add("checkbox", [11, 68, 81, 88], "路径");
havePT.value = AutoMarkXml.havePT - 0;
bite = xinxizu.add("checkbox", [11, 92, 81, 112], "咬 口");
bite.value = AutoMarkXml.bite - 0;
littleSize = xinxizu.add("checkbox", [83, 18, 153, 38], "单模尺寸");
littleSize.value = AutoMarkXml.littleSize - 0;
bigSize = xinxizu.add("checkbox", [83, 43, 153, 63], "拼版尺寸");
bigSize.value = AutoMarkXml.bigSize - 0;
paperSize = xinxizu.add("checkbox", [83, 69, 153, 89], "角线尺寸");
paperSize.value = AutoMarkXml.paperSize - 0;
paperSize1 = xinxizu.add("checkbox", [83, 92, 153, 112], "纸张尺寸");
paperSize1.value = AutoMarkXml.paperSize1 - 0;
beizhuzu = regWin.add("group", [0, 214, 230, 241], "undefined");
otherInfo = beizhuzu.add("statictext", [21, 7, 91, 27], "备注:", {
multiline: true
});
oiValue = beizhuzu.add("edittext", [60, 3, 225, 23], AutoMarkXml.oiValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
CTPzu = regWin.add("group", [0, 239, 390, 387], "undefined");
CTPxian = CTPzu.add("panel", [12, 5, 387, 135], "CTP");
paperInfo = CTPzu.add("statictext", [23, 29, 93, 49], "纸张:", {
multiline: true
});
paperW = CTPzu.add("edittext", [60, 25, 110, 45], AutoMarkXml.paperW, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
X1 = CTPzu.add("statictext", [115, 29, 185, 49], "X", {
multiline: true
});
paperH = CTPzu.add("edittext", [130, 25, 180, 45], AutoMarkXml.paperH, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
paper3 = regWin.add("statictext", [195, 267, 238, 287], "咬口:");
paperB = CTPzu.add("edittext", [238, 25, 275, 45], AutoMarkXml.paperB, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
platoInfo = CTPzu.add("statictext", [22, 54, 92, 74], "版材:", {
multiline: true
});
platoW = CTPzu.add("edittext", [60, 50, 110, 70], AutoMarkXml.platoW, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
X2 = CTPzu.add("statictext", [115, 55, 185, 75], "X", {
multiline: true
});
platoH = CTPzu.add("edittext", [130, 50, 180, 70], AutoMarkXml.platoH, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
plate3 = CTPzu.add("statictext", [195, 53, 238, 73], "咬口:");
platoB = CTPzu.add("edittext", [238, 50, 275, 70], AutoMarkXml.platoB, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
cxdb = CTPzu.add("statictext", [283, 53, 353, 73], " 去 边:", {
multiline: true
});
cxdbkuang = CTPzu.add("edittext", [336, 50, 376, 70], AutoMarkXml.cxdbkuang, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
autopage = regWin.add("checkbox", [27, 320, 97, 340], "自动页面");
autopage.value = AutoMarkXml.autopage - 0;
ABtrans = regWin.add("checkbox", [130, 320, 200, 340], "版纸设定");
ABtrans.value = AutoMarkXml.ABtrans - 0;
gird = regWin.add("checkbox", [230, 320, 300, 340], "辅助线");
gird.value = AutoMarkXml.gird - 0;
onlyCTP = regWin.add("checkbox", [318, 320, 388, 340], "仅 CTP");
onlyCTP.value = AutoMarkXml.onlyCTP - 0;
autopage.onClick = function() {
if (autopage.value == true) {
ABtrans.value = false;
gird.value = false;
onlyCTP.value = false;
}
};
ABtrans.onClick = gird.onClick = onlyCTP.onClick = function() {
if (ABtrans.value == true || gird.value == true || onlyCTP.value == true) {
autopage.value = false;
}
};
selectFile = regWin.add("button", [27, 345, 77, 365], "链 接:");
sfValue = regWin.add("edittext", [85, 345, 230, 365], AutoMarkXml.sfValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
selectFile.onClick = function() {
vará = File.openDialog("选择脚本", "PDF:*.pdf,EPS:*.eps,AI:*.ai", false);
if (á != null) {
sfValue.text = á.fsName
}
};
linkMove = regWin.add("statictext", [239, 350, 309, 367], "位 移:", {
multiline: true
});
lmValue = regWin.add("edittext", [280, 345, 316, 365], AutoMarkXml.lmValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
embed = regWin.add("checkbox", [330, 345, 400, 368], "嵌入");
embed.value = AutoMarkXml.embed - 0;
zelanzu = regWin.add("group", [390, 0, 475, 385], "undefined");
okBt = zelanzu.add("button", [3, 16, 76, 36], "确定");
cancleBt = zelanzu.add("button", [3, 46, 76, 66], "取消");
yuzhi = zelanzu.add("button", [3, 75, 76, 95], "预置");
yushe1 = zelanzu.add("button", [3, 125, 76, 145], "预设一");
yushe2 = zelanzu.add("button", [3, 153, 76, 173], "预设二");
yushe3 = zelanzu.add("button", [3, 181, 36, 201], "三");
yushe4 = zelanzu.add("button", [43, 181, 76, 201], "四");
yushe5 = zelanzu.add("button", [3, 210, 36, 230], "五");
yushe6 = zelanzu.add("button", [43, 210, 76, 230], "六");
yushe7 = zelanzu.add("button", [3, 240, 36, 260], "七");
yushe8 = zelanzu.add("button", [43, 240, 76, 260], "八");
yushe9 = zelanzu.add("button", [3, 270, 36, 290], "九");
yushe10 = zelanzu.add("button", [43, 270, 76, 290], "十");
yushe11 = zelanzu.add("button", [3, 300, 36, 320], "11");
yushe12 = zelanzu.add("button", [43, 300, 76, 320], "12");
baocunshezhi = zelanzu.add("button", [3, 330, 76, 370], "保存设置");
okBt.onClick = function() {function4 ();
regWin2.close();function7 ();
v = 2.83464566929134;
linelength = lLValue.text * v;
lw = lwValue.text * v;
linespace = lSValue.text * v;
outspace = oSValue.text * v;
qubian = cxdbkuang.text * v;
if (boolCx.value == true) {
boolC = true;
} else {
boolC = false;
}
if (boolMx.value == true) {
boolM = true;
} else {
boolM = false;
}
if (boolYx.value == true) {
boolY = true;
} else {
boolY = false;
}
if (boolKx.value == true) {
boolK = true;
} else {
boolK = false;
}
cspace = csValue.text * v;
ptRe = prValue.text;
od = rdValue.text * v;
cw = cwValue.text * v;
ch = chValue.text * v;
level = clValue.text;
Plate_width = platoW.text * v;
Plate_heigth = platoH.text * v;
Plate_bite = platoB.text * v;
Paper_width = paperW.text * v;
Paper_heigth = paperH.text * v;
Paper_bite = paperB.text * v;
if (CMYK.value == true) {
colormodul = 0;
}
if (mingcheng.value == true) {
colormodul = 1;
}
if (wu.value == true) {
colormodul = 2;
}
if (buhanchuxue.value == true) {
bleeded = false;
bleeded2 = false;
}
if (quanbuchuxue.value == true) {
bleeded = true;
bleeded2 = true;
}
if (dabanchuxue.value == true) {
bleeded = true;
bleeded2 = false;
}
if (doubleLine.value == true) {
shuangjiaoxian = true;
} else {
shuangjiaoxian = false;
}
if (JPLine.value == true) {
rishicaiqie = true;
} else {
rishicaiqie = false;
}
for (vari = 0;i
关注
打赏
最近更新
- 深拷贝和浅拷贝的区别(重点)
- 【Vue】走进Vue框架世界
- 【云服务器】项目部署—搭建网站—vue电商后台管理系统
- 【React介绍】 一文带你深入React
- 【React】React组件实例的三大属性之state,props,refs(你学废了吗)
- 【脚手架VueCLI】从零开始,创建一个VUE项目
- 【React】深入理解React组件生命周期----图文详解(含代码)
- 【React】DOM的Diffing算法是什么?以及DOM中key的作用----经典面试题
- 【React】1_使用React脚手架创建项目步骤--------详解(含项目结构说明)
- 【React】2_如何使用react脚手架写一个简单的页面?