Adobe Illustrator【印前角线X2.0】脚本源码
var scriptName = "AutoMark";
var Ver = "X2.0";
var set_folder = Folder.myDocuments + "/【印前角线X2.0】数据文件/" + scriptName + "/";
gArgG = gArgG0 = gArgG2 = gArgG3 = gArgG4 = gArgG5 = set_folder + scriptName + "_" + Ver + ".xml";
ys0 = set_folder + "AutoMark_20.xml";
ys1 = set_folder + "AutoMark_21.xml";
ys2 = set_folder + "AutoMark_22.xml";
ys3 = set_folder + "AutoMark_23.xml";
ys4 = set_folder + "AutoMark_24.xml";
ys5 = set_folder + "AutoMark_25.xml";
Preset = set_folder + "Preset.xml";
checkSetFolder();
function function1() {
NewFileVal = new File(gArgG);
if (NewFileVal.exists == false) {
function2();
}
Presetinfo = function3("read", Preset);
PresetXml = new XML(Presetinfo);
AutoMarkinfo = function3("read", gArgG);
AutoMarkXml = new XML(AutoMarkinfo);
regWin = new Window("dialog", "印前角线" + Ver + "", [0, 0, 420, 270], {
resizeable: true,
resizeable: false
});
//选项-----------------------------------------------------------------------
wd = regWin.add("tabbedpanel", [10, 10, 410, 218]);
CTPzu = wd.add("tab", [0, 0, 410, 218], "CTP/预设");
caiqiexianzu = wd.add("tab", [0, 0, 410, 218], "裁切线/颜色");
xinxizu = wd.add("tab", [0, 0, 410, 218], "信息/链接");
qitazu = wd.add("tab", [0, 0, 410, 218], "其他/记事本");
dinzishuzu = wd.add("tab", [0, 0, 410, 218], "电子书");
bangzhu = wd.add("tab", [0, 0, 410, 218], "帮助");
//线条-----------------------------------------------------------------------
xitiao1 = CTPzu.add("panel", [10, 87, 385, 90], "");
xitiao2 = caiqiexianzu.add("panel", [10, 87, 385, 90], "");
xitiao3 = xinxizu.add("panel", [10, 87, 385, 90], "");
xitiao4 = xinxizu.add("panel", [90, 103, 93, 143], "");
xitiao5 = qitazu.add("panel", [10, 87, 385, 90], "");
//记事本-----------------------------------------------------------------------
note1 = qitazu.add("edittext", [10, 100, 385, 170], AutoMarkXml.note1, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 1,
enterKeySignalsOnChange: 0
});
//电子书-----------------------------------------------------------------------
note2 = dinzishuzu.add("edittext", [10, 10, 385, 170], AutoMarkXml.note2, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 1,
enterKeySignalsOnChange: 0
});
//帮助-----------------------------------------------------------------------
note3 = bangzhu.add("edittext", [10, 10, 385, 170], "【印前角线X2.0】\
\
【使用方法】\
将压缩包中的〖AI印前角线X2.0.jsx〗脚本文件,复制到AI软件《Presets》(中文版是预设)—《zh-CN》—《脚本》文件夹中,重启AI软件,就可以在《文件》—《脚本》目录下找到〖AI印前角线X2.0〗菜单。\
【字体设置】\
〖其他〗一〖字体〗[宋体]一〖确定〗,这时正在使用中的脚本将会生成宋体。AI CS6 只能设置微软雅黑和宋体,CC 2015 以上版本可以设置微软雅黑,华文宋体,华文楷体,华文仿宋,黑体等部分字体。\
【齿线折线】\
齿线服装吊牌。首先画一个宽50mm x高80mm矩形,然后画一个3mm圆孔,将〖矩形+圆〗群组,最后画一根50mm齿线,齿线长度一定要同矩形宽度一样,〖矩形+圆〗和〖齿线〗不要群组,全选框线打开〖印前角线〗脚本点击〖确定〗,〖印前角线〗就会在吊牌外框和有齿线的地方生成裁切线。\
【成品尺寸】\
齿线入场券。先画1个矩形,再画一根齿线〖置于底层〗,〖矩形〗和〖齿线〗不要群组,首先复制20张入场券,然后全选框线打开〖印前角线〗脚本,勾选〖成品尺寸〗点击〖确定〗,这时〖印前角线〗就会在20张入场券外框和有齿线的地方生成裁切线,同时也会生成入场券〖成品尺寸〗数据。\
【版纸设定】\
定位角线在版材中的位置。全选框线打开〖印前角线〗脚本,〖默认〗一〖版纸设定〗勾选一〖确定〗,这时成品框线就在默认数据〖版材650x550mm〗和〖咬口60mm〗处生成角线,可以直接存储为PDF文件出CTP。你也可以输入需要的版材尺寸等数据,勾选〖版纸设定〗,保存到预设〖一〗至〖五〗里面,方便以后调用面板预设数据。\
【正拉规】\
首先在AI软件里面一比一画拉规线条,存储『拉规线.PDF』文件到D盘或其它盘内。全选框线打开〖印前角线〗脚本,〖默认〗一〖链接〗一〖正拉规〗勾选一〖拉规〗选择『拉规线.PDF』—〖确定〗,正拉规线就会在默认数据〖版材650x550mm〗+〖咬口60mm〗+〖位移110mm〗生成。\
【记事栏】\
填写〖一〗至〖五〗按钮的作用。首先在面板上输入650x550mm版材所需要的所有参数,在面板〖一〗按钮上方输入〖650*550〗版材尺寸名称,在〖二〗至〖五〗按钮上方输入其它版材尺寸名称,〖保存〗一〖预设〗一〖一〗一〖确定〗,这时面板〖一〗里面就是〖650x550〗版材参数。然后修改面板参数〖设置〗一〖预设〗一〖二〗一〖确定〗,这时面板〖二〗里面就是其它参数,以此类推。\
【链接】\
可以同时链接〖拉规〗拉规线.PDF +〖顶部〗色条.PDF +〖底部〗测控条.PDF,共三个PDF文件。\
【记事本】\
可以存储客户信息以及后道工艺流程,方便用户复制粘贴文本到AI软件中或〖备注〗栏内。\
【电子书】\
可以存储大量信息,方便用户复制粘贴文本到AI软件中或〖备注〗栏内。\
示例:如果控制面板〖二〗里面预存了其它数据,可以先点控制面板〖二〗读取已经保存的数据,再点击〖电子书〗,在电子书里写好需要保存的文字,〖保存〗—〖保存位置〗—〖二〗—〖确定〗,这时控制面板〖二〗里面就在原来的数据上面添加了〖电子书〗文字。如果需要读取电子书文本,点击控制面板〖二〗—〖电子书〗就可以复制电子书文本。\
【纸张尺寸】\
输入〖纸张尺寸〗数据,点击〖确定〗可以生成〖纸张尺寸〗框线,〖CTP〗选项设置框线〖粗细〗,〖其他〗选项设置框线〖颜色〗。\
【常见问题】\
专色隶属于CMYK组,CMYK至少勾选一个颜色,专色才会显示。例如〖PANTONE 185 C〗色标,脚本默认显示〖185 C〗,如果需要显示全称潘通专色,在〖PANTONE代替:〗后面框内输入〖PANTONE+空格〗或〖潘通〗,即可显示〖PANTONE 185 C〗或〖潘通185 C〗。\
【最新版本】\
〖印前角线V20.0〗大版式输出版\
〖精简角线V6.0〗大版式印务版\
〖印前角线X2.0〗小版式输出版\
〖印前角线Z3.0〗折叠式印务版\
【参考文献】\
[1] CPC中文印刷社区 http://www.cnprint.org\
[2] 角线X v7.3 tiandiyiqi\
[3] 增强版角线 WJL-8.3 WJL修改版\
\
CPC中文印刷社区\
tiantian1998\
2022年5月20日", {
readonly: 1,
noecho: 0,
borderless: 0,
multiline: 1,
enterKeySignalsOnChange: 0
});
//裁切线-----------------------------------------------------------------------
lineLengh = caiqiexianzu.add("statictext", [10, 10, 50, 30], "长度:");
lLValue = caiqiexianzu.add("edittext", [47, 10, 85, 30], AutoMarkXml.lLValue);
linewide = caiqiexianzu.add("statictext", [100, 10, 140, 30], "粗细:");
lwValue = caiqiexianzu.add("edittext", [135, 10, 175, 30], AutoMarkXml.lwValue);
outSpace = caiqiexianzu.add("statictext", [10, 35, 50, 55], "出血:");
oSValue = caiqiexianzu.add("edittext", [48, 35, 85, 55], AutoMarkXml.oSValue);
lineSpace = caiqiexianzu.add("statictext", [100, 35, 140, 55], "偏移:");
lSValue = caiqiexianzu.add("edittext", [135, 35, 175, 55], AutoMarkXml.lSValue);
szkd = caiqiexianzu.add("statictext", [189, 10, 264, 30], "十字宽度:", {
multiline: true
});
kdValue = caiqiexianzu.add("edittext", [252, 10, 289, 30], AutoMarkXml.kdValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
szgd = caiqiexianzu.add("statictext", [189, 35, 264, 55], "十字高度:", {
multiline: true
});
gdValue = caiqiexianzu.add("edittext", [252, 35, 289, 55], AutoMarkXml.gdValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
szgd.helpTip = "十字线高度不能大于裁切线长度!";
gdValue.helpTip = "十字线高度不能大于裁切线长度!";
roundD = caiqiexianzu.add("statictext", [310, 10, 360, 30], "圆形:", {
multiline: true
});
rdValue = caiqiexianzu.add("edittext", [348, 10, 385, 30], AutoMarkXml.rdValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
rdValue.helpTip = "设置十字线圆形直径";
ztpy = caiqiexianzu.add("statictext", [310, 35, 360, 55], "偏移:", {
multiline: true
});
pyValue = caiqiexianzu.add("edittext", [348, 35, 385, 55], AutoMarkXml.pyValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
pyValue.helpTip = "调节十字线加圆形整体向外偏移";
havebleed = caiqiexianzu.add("statictext", [10, 60, 120, 80], "模式:");
buhanchuxue = caiqiexianzu.add("radiobutton", [50, 60, 110, 80], "不含");
buhanchuxue.helpTip = "不含出血模式";
buhanchuxue.value = AutoMarkXml.buhanchuxue - 0;
quanbuchuxue = caiqiexianzu.add("radiobutton", [109, 60, 169, 80], "全部");
quanbuchuxue.helpTip = "全部出血模式";
quanbuchuxue.value = AutoMarkXml.quanbuchuxue - 0;
dabanchuxue = caiqiexianzu.add("radiobutton", [169, 60, 229, 80], "大版");
dabanchuxue.helpTip = "大版出血模式";
dabanchuxue.value = AutoMarkXml.dabanchuxue - 0;
doubleLine = caiqiexianzu.add("checkbox", [230, 60, 330, 80], "双角线");
doubleLine.value = AutoMarkXml.doubleLine - 0;
JPLine = caiqiexianzu.add("checkbox", [306, 60, 386, 80], "日式角线");
JPLine.value = AutoMarkXml.JPLine - 0;
//颜色-----------------------------------------------------------------------
CMYK = caiqiexianzu.add("radiobutton", [10, 100, 100, 120], "英文");
CMYK.value = AutoMarkXml.CMYK - 0;
mingcheng = caiqiexianzu.add("radiobutton", [62, 100, 142, 120], "中英文");
mingcheng.value = AutoMarkXml.mingcheng - 0;
wu = caiqiexianzu.add("radiobutton", [125, 100, 165, 120], "无");
wu.value = AutoMarkXml.wu - 0;
boolCx = caiqiexianzu.add("checkbox", [10, 125, 40, 145], "C");
boolCx.value = AutoMarkXml.boolCx - 0;
boolMx = caiqiexianzu.add("checkbox", [48, 125, 88, 145], "M");
boolMx.value = AutoMarkXml.boolMx - 0;
boolYx = caiqiexianzu.add("checkbox", [87, 125, 117, 145], "Y");
boolYx.value = AutoMarkXml.boolYx - 0;
boolKx = caiqiexianzu.add("checkbox", [125, 125, 155, 145], "K");
boolKx.value = AutoMarkXml.boolKx - 0;
ptReplace = caiqiexianzu.add("statictext", [10, 153, 110, 173], "PANTONE代替:", {
multiline: true
});
prValue = caiqiexianzu.add("edittext", [96, 150, 165, 170], AutoMarkXml.prValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
prValue.helpTip = "如果需要显示全称潘通专色,输入英文〖PANTONE+空格〗或者输入中文〖潘通〗";
colorLable = caiqiexianzu.add("checkbox", [175, 100, 225, 120], "色条");
colorLable.value = AutoMarkXml.colorLable - 0;
colorWide = caiqiexianzu.add("statictext", [227, 100, 267, 120], "宽:", {
multiline: true
});
cwValue = caiqiexianzu.add("edittext", [252, 100, 289, 120], AutoMarkXml.cwValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
colorHigh = caiqiexianzu.add("statictext", [227, 125, 267, 145], "高:", {
multiline: true
});
chValue = caiqiexianzu.add("edittext", [252, 125, 289, 145], AutoMarkXml.chValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
colorSpace = caiqiexianzu.add("statictext", [310, 100, 360, 120], "间距:", {
multiline: true
});
csValue = caiqiexianzu.add("edittext", [348, 100, 385, 120], AutoMarkXml.csValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
stpy = caiqiexianzu.add("statictext", [310, 125, 360, 145], "偏移:", {
multiline: true
});
py4Value = caiqiexianzu.add("edittext", [348, 125, 385, 145], AutoMarkXml.py4Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
py4Value.helpTip = "调节色条上下偏移";
colorlevel = caiqiexianzu.add("statictext", [189, 153, 269, 173], "色阶:", {
multiline: true
});
clValue = caiqiexianzu.add("edittext", [227, 150, 385, 170], AutoMarkXml.clValue, {
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;
}
};
//其他-----------------------------------------------------------------------
weidong1 = qitazu.add("statictext", [10, 10, 90, 30], "制作:", {
multiline: true
});
weidong2 = qitazu.add("edittext", [48, 10, 118, 30], AutoMarkXml.weidong2, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
fontname = qitazu.add("statictext", [10, 35, 90, 55], "字体:", {
multiline: true
});
fnValue = qitazu.add("edittext", [48, 35, 118, 55], AutoMarkXml.fnValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
fnValue.helpTip = "AI CS6 只能设置微软雅黑和宋体,CC 2015 以上版本可以设置微软雅黑,华文宋体,华文楷体,华文仿宋,黑体等部分字体。";
fontsize = qitazu.add("statictext", [10, 60, 90, 80], "大小 pt:", {
multiline: true
});
fsValue = qitazu.add("edittext", [70, 60, 118, 80], AutoMarkXml.fsValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
fsValue.helpTip = "设置字体大小";
infoText = qitazu.add("statictext", [135, 10, 235, 30], "CPC中文印刷社区");
infoText.margins = 0;
infoText.enabled = false;
sxpy = qitazu.add("statictext", [135, 35, 215, 55], "上下偏移:", {
multiline: true
});
py2Value = qitazu.add("edittext", [198, 35, 238, 55], AutoMarkXml.py2Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
py2Value.helpTip = "调节信息文字和颜色向外偏移";
zypy = qitazu.add("statictext", [135, 60, 215, 80], "左右偏移:", {
multiline: true
});
py3Value = qitazu.add("edittext", [198, 60, 238, 80], AutoMarkXml.py3Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
py3Value.helpTip = "调节文件名前面空格";
zzyscz = qitazu.add("statictext", [257, 10, 390, 30], "CTP纸张框线颜色设置");
langshe = qitazu.add("statictext", [257, 35, 277, 55], "C", {
multiline: true
});
py11Value = qitazu.add("edittext", [274, 35, 314, 55], AutoMarkXml.py11Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
hongshe = qitazu.add("statictext", [328, 35, 348, 55], "M", {
multiline: true
});
py12Value = qitazu.add("edittext", [345, 35, 385, 55], AutoMarkXml.py12Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
huangshe = qitazu.add("statictext", [257, 60, 277, 80], "Y", {
multiline: true
});
py13Value = qitazu.add("edittext", [274, 60, 314, 80], AutoMarkXml.py13Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
heishe = qitazu.add("statictext", [328, 60, 348, 80], "K", {
multiline: true
});
py14Value = qitazu.add("edittext", [345, 60, 385, 80], AutoMarkXml.py14Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
// 信息-----------------------------------------------------------------------
haveFN = xinxizu.add("checkbox", [10, 10, 70, 30], "文件名");
haveFN.value = AutoMarkXml.haveFN - 0;
haveTM = xinxizu.add("checkbox", [10, 35, 70, 55], "日期");
haveTM.value = AutoMarkXml.haveTM - 0;
havePT = xinxizu.add("checkbox", [10, 60, 70, 80], "路径");
havePT.value = AutoMarkXml.havePT - 0;
yaokou = xinxizu.add("panel", [71, 10, 161, 80], "咬口");
bite2 = yaokou.add("checkbox", [10, 16, 70, 36], "上");
bite2.value = AutoMarkXml.bite2 - 0;
bite = yaokou.add("checkbox", [10, 41, 70, 61], "下");
bite.value = AutoMarkXml.bite - 0;
bite3 = yaokou.add("checkbox", [48, 16, 80, 36], "左");
bite3.value = AutoMarkXml.bite3 - 0;
bite4 = yaokou.add("checkbox", [48, 41, 80, 61], "右");
bite4.value = AutoMarkXml.bite4 - 0;
chichun = xinxizu.add("panel", [161, 10, 279, 80], "尺寸");
bigSize = chichun.add("checkbox", [10, 16, 70, 36], "拼版");
bigSize.value = AutoMarkXml.bigSize - 0;
littleSize = chichun.add("checkbox", [10, 41, 70, 61], "成品");
littleSize.value = AutoMarkXml.littleSize - 0;
paperSize1 = chichun.add("checkbox", [62, 16, 130, 36], "纸张");
paperSize1.value = AutoMarkXml.paperSize1 - 0;
paperSize = chichun.add("checkbox", [62, 41, 130, 61], "角线");
paperSize.value = AutoMarkXml.paperSize - 0;
wzzs = xinxizu.add("checkbox", [288, 10, 348, 30], "左上");
wzzs.value = AutoMarkXml.wzzs - 0;
wzzc = xinxizu.add("checkbox", [288, 35, 348, 55], "左侧");
wzzc.value = AutoMarkXml.wzzc - 0;
wzzx = xinxizu.add("checkbox", [288, 60, 348, 80], "左下");
wzzx.value = AutoMarkXml.wzzx - 0;
wzys = xinxizu.add("checkbox", [343, 10, 403, 30], "右上");
wzys.value = AutoMarkXml.wzys - 0;
wzyc = xinxizu.add("checkbox", [343, 35, 403, 55], "右侧");
wzyc.value = AutoMarkXml.wzyc - 0;
wzyx = xinxizu.add("checkbox", [343, 60, 403, 80], "右下");
wzyx.value = AutoMarkXml.wzyx - 0;
//CTP-----------------------------------------------------------------------
paperInfo = CTPzu.add("statictext", [10, 10, 85, 30], "纸张:", {
multiline: true
});
paperW = CTPzu.add("edittext", [50, 10, 100, 30], AutoMarkXml.paperW, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
X1 = CTPzu.add("statictext", [110, 12, 180, 32], "X", {
multiline: true
});
paperH = CTPzu.add("edittext", [126, 10, 176, 30], AutoMarkXml.paperH, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
paper3 = CTPzu.add("statictext", [193, 10, 243, 30], "咬口:");
paperB = CTPzu.add("edittext", [231, 10, 281, 30], AutoMarkXml.paperB, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
chuxi = CTPzu.add("statictext", [296, 10, 346, 30], "粗细:", {
multiline: true
});
py21Value = CTPzu.add("edittext", [335, 10, 385, 30], AutoMarkXml.py21Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
py21Value.helpTip = "调节纸张框线粗细,默认:0.25 磅。\
调节纸张框线颜色,请在〖其他〗选项里面设置。";
platoInfo = CTPzu.add("statictext", [10, 35, 85, 55], "版材:", {
multiline: true
});
platoW = CTPzu.add("edittext", [50, 35, 100, 55], AutoMarkXml.platoW, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
X2 = CTPzu.add("statictext", [110, 37, 180, 57], "X", {
multiline: true
});
platoH = CTPzu.add("edittext", [126, 35, 176, 55], AutoMarkXml.platoH, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
plate3 = CTPzu.add("statictext", [193, 35, 243, 55], "咬口:");
platoB = CTPzu.add("edittext", [231, 35, 281, 55], AutoMarkXml.platoB, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
cxdb = CTPzu.add("statictext", [296, 35, 346, 55], "去边:", {
multiline: true
});
cxdbkuang = CTPzu.add("edittext", [335, 35, 385, 55], AutoMarkXml.cxdbkuang, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
autopage = CTPzu.add("checkbox", [10, 60, 90, 80], "自动页面");
autopage.helpTip = "自动页面尺寸等于角线尺寸页面";
autopage.value = AutoMarkXml.autopage - 0;
ABtrans = CTPzu.add("checkbox", [103, 60, 183, 80], "版纸设定");
ABtrans.helpTip = "在纸张尺寸和版材尺寸时使用";
ABtrans.value = AutoMarkXml.ABtrans - 0;
gird = CTPzu.add("checkbox", [195, 60, 255, 80], "辅助线");
gird.helpTip = "生成辅助线会被锁定,解锁辅助线:菜单栏—对象—全部解锁";
gird.value = AutoMarkXml.gird - 0;
onlyCTP = CTPzu.add("checkbox", [275, 60, 375, 80], "仅CTP");
onlyCTP.helpTip = "勾选〖版纸设定〗加〖仅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;
}
};
//链接-----------------------------------------------------------------------
zlagui = xinxizu.add("checkbox", [10, 100, 80, 120], "正拉规");
zlagui.helpTip = "勾选正拉规,需要选择〖拉规〗选项";
zlagui.value = AutoMarkXml.zlagui - 0;
flagui = xinxizu.add("checkbox", [10, 125, 80, 145], "反拉规");
flagui.helpTip = "勾选反拉规,需要选择〖拉规〗选项";
flagui.value = AutoMarkXml.flagui - 0;
zlagui.onClick = function() {
flagui.value = false;
};
flagui.onClick = function() {
zlagui.value = false;
};
sblink = xinxizu.add("button", [115, 100, 165, 120], "顶部");
sblink.helpTip = "选择〖色条.PDF〗文件";
sbValue = xinxizu.add("edittext", [175, 100, 280, 120], AutoMarkXml.sbValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
sblink.onClick = function() {
var jxaa = File.openDialog("选择文件", "PDF:*.pdf,EPS:*.eps,AI:*.ai", false);
if (jxaa != null) {
sbValue.text = jxaa.fsName;
}
};
sxpy2 = xinxizu.add("statictext", [305, 103, 355, 123], "上下:", {
multiline: true
});
py5Value = xinxizu.add("edittext", [345, 100, 385, 120], AutoMarkXml.py5Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
py5Value.helpTip = "调节〖顶部〗色条链接文件上下偏移";
sclink = xinxizu.add("button", [115, 125, 165, 145], "底部");
sclink.helpTip = "选择〖测控条.PDF〗文件";
scValue = xinxizu.add("edittext", [175, 125, 280, 145], AutoMarkXml.scValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
sclink.onClick = function() {
var jxaa = File.openDialog("选择文件", "PDF:*.pdf,EPS:*.eps,AI:*.ai", false);
if (jxaa != null) {
scValue.text = jxaa.fsName;
}
};
sxpy3 = xinxizu.add("statictext", [305, 128, 355, 148], "上下:", {
multiline: true
});
py6Value = xinxizu.add("edittext", [345, 125, 385, 145], AutoMarkXml.py6Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
embed = xinxizu.add("checkbox", [0, 0, 0, 0], "");
embed.value = AutoMarkXml.embed - 0;
py6Value.helpTip = "调节〖底部〗测控条链接文件上下偏移";
selectFile = xinxizu.add("button", [10, 150, 60, 170], "拉规");
selectFile.helpTip = "选择〖拉规线.PDF〗文件";
sfValue = xinxizu.add("edittext", [70, 150, 175, 170], AutoMarkXml.sfValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
selectFile.onClick = function() {
var jxaa = File.openDialog("选择文件", "PDF:*.pdf,EPS:*.eps,AI:*.ai", false);
if (jxaa != null) {
sfValue.text = jxaa.fsName;
}
};
link2Move = xinxizu.add("statictext", [200, 153, 250, 173], "左右:", {
multiline: true
});
lm2Value = xinxizu.add("edittext", [240, 150, 280, 170], AutoMarkXml.lm2Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
lm2Value.helpTip = "调节〖拉规〗链接文件左右偏移";
linkMove = xinxizu.add("statictext", [305, 153, 355, 173], "上下:", {
multiline: true
});
lmValue = xinxizu.add("edittext", [345, 150, 385, 170], AutoMarkXml.lmValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
lmValue.helpTip = "调节〖拉规〗链接文件上下偏移";
embed = xinxizu.add("checkbox", [0, 0, 0, 0], "");
embed.value = AutoMarkXml.embed - 0;
//预设-----------------------------------------------------------------------
otherInfo = CTPzu.add("statictext", [12.5, 100, 102.5, 120], "备注:", {
multiline: true
});
oiValue = CTPzu.add("edittext", [51, 100, 382.5, 120], AutoMarkXml.oiValue, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
szjsl1 = CTPzu.add("edittext", [12.5, 125, 82.5, 145], AutoMarkXml.szjsl1, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
szjsl2 = CTPzu.add("edittext", [87.5, 125, 157.5, 145], AutoMarkXml.szjsl2, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
szjsl3 = CTPzu.add("edittext", [162.5, 125, 232.5, 145], AutoMarkXml.szjsl3, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
szjsl4 = CTPzu.add("edittext", [237.5, 125, 307.5, 145], AutoMarkXml.szjsl4, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
szjsl5 = CTPzu.add("edittext", [312.5, 125, 382.5, 145], AutoMarkXml.szjsl5, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
yushe1 = CTPzu.add("button", [12.5, 150, 82.5, 170], "一");
yushe2 = CTPzu.add("button", [87.5, 150, 157.5, 170], "二");
yushe3 = CTPzu.add("button", [162.5, 150, 232.5, 170], "三");
yushe4 = CTPzu.add("button", [237.5, 150, 307.5, 170], "四");
yushe5 = CTPzu.add("button", [312.5, 150, 382.5, 170], "五");
chushi = regWin.add("button", [20, 232, 70, 255], "默认");
yuzhi = regWin.add("button", [75, 232, 125, 255], "保存");
yushe0 = regWin.add("button", [130, 232, 180, 255], "常用");
okBt = regWin.add("button", [235, 232, 315, 255], "确定", {
name: "ok"
});
cancleBt = regWin.add("button", [320, 232, 400, 255], "取消");
chushi.helpTip = "还原为默认数据";
yushe1.helpTip = "调取预设一数据";
yushe2.helpTip = "调取预设二数据";
yushe3.helpTip = "调取预设三数据";
yushe4.helpTip = "调取预设四数据";
yushe5.helpTip = "调取预设五数据";
yuzhi.helpTip = "保存预设数据";
yushe0.helpTip = "调取预设常用数据";
okBt.helpTip = "确定请按回车键";
cancleBt.helpTip = "取消请按Esc键";
okBt.onClick = function() {
function4();
regWin2.close();
if (gArgG === ys1 || gArgG2 === ys2 || gArgG3 === ys3 || gArgG4 === ys4 || gArgG5 === ys5 || gArgG0 === ys0) {
gArgG = gArgG2 = gArgG3 = gArgG4 = gArgG5 = gArgG0;
function7();
} else {
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 (var i = 0; i < textFonts.length; i += 1) {
if (textFonts[i].family == fnValue.text && textFonts[i].style == "Regular" || textFonts[i].style == "MicrosoftYaHei" || textFonts[i].style == "L" || textFonts[i].style == "R") {
Textfontname = textFonts[i];
}
}
textfontsize = fsValue.text;
regWin.close();
function6();
};
cancleBt.onClick = function() {
regWin.close();
};
yuzhi.onClick = function() {
function4();
regWin2.center();
regWin2.show();
};
chushi.onClick = function() {
gArgG = gArgG2;
function2();
regWin.close();
function1();
};
yushe0.onClick = function() {
gArgG = ys0;
NewFileVal = new File(gArgG);
if (NewFileVal.exists == false) {
alert("请先保存预设!");
} else {
regWin.close();
function1();
}
};
yushe1.onClick = function() {
gArgG = ys1;
NewFileVal = new File(gArgG);
if (NewFileVal.exists == false) {
alert("请先保存预设!");
} else {
regWin.close();
function1();
}
};
yushe2.onClick = function() {
gArgG = ys2;
NewFileVal = new File(gArgG);
if (NewFileVal.exists == false) {
alert("请先保存预设!");
} else {
regWin.close();
function1();
}
};
yushe3.onClick = function() {
gArgG = ys3;
NewFileVal = new File(gArgG);
if (NewFileVal.exists == false) {
alert("请先保存预设!");
} else {
regWin.close();
function1();
}
};
yushe4.onClick = function() {
gArgG = ys4;
NewFileVal = new File(gArgG);
if (NewFileVal.exists == false) {
alert("请先保存预设!");
} else {
regWin.close();
function1();
}
};
yushe5.onClick = function() {
gArgG = ys5;
NewFileVal = new File(gArgG);
if (NewFileVal.exists == false) {
alert("请先保存预设!");
} else {
regWin.close();
function1();
}
};
regWin.center();
regWin.show();
}
function openURL(address) {
var f = File(Folder.temp + "/aiOpenURL.url");
f.open("w");
f.write("[InternetShortcut]\rURL=http://" + address + "\r");
f.close();
f.execute();
}
function function4() {
regWin2 = new Window("dialog", "保存", [0, 10, 325, 127], {
resizeable: true,
resizeable: false
});
yushe2 = regWin2.add("panel", [10, 10, 315, 68], "保存位置");
weizhi0 = yushe2.add("radiobutton", [15, 15, 75, 35], "常用");
weizhi0.value = 1;
weizhi1 = yushe2.add("radiobutton", [75, 15, 120, 35], "一");
weizhi1.value = 0;
weizhi2 = yushe2.add("radiobutton", [120, 15, 165, 35], "二");
weizhi2.value = 0;
weizhi3 = yushe2.add("radiobutton", [165, 15, 210, 35], "三");
weizhi3.value = 0;
weizhi4 = yushe2.add("radiobutton", [210, 15, 255, 35], "四");
weizhi4.value = 0;
weizhi5 = yushe2.add("radiobutton", [255, 15, 300, 35], "五");
weizhi5.value = 0;
ys0Value = yushe2.add("edittext", [0, 0, 0, 0], PresetXml.ys0Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
ys0Value.enabled = false;
ys1Value = yushe2.add("edittext", [0, 0, 0, 0], PresetXml.ys1Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
ys1Value.enabled = false;
ys2Value = yushe2.add("edittext", [0, 0, 0, 0], PresetXml.ys2Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
ys2Value.enabled = false;
ys3Value = yushe2.add("edittext", [0, 0, 0, 0], PresetXml.ys3Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
ys3Value.enabled = false;
ys4Value = yushe2.add("edittext", [0, 0, 0, 0], PresetXml.ys4Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
ys4Value.enabled = false;
ys5Value = yushe2.add("edittext", [0, 0, 0, 0], PresetXml.ys5Value, {
readonly: 0,
noecho: 0,
borderless: 0,
multiline: 0,
enterKeySignalsOnChange: 0
});
ys5Value.enabled = false;
weizhi1.onClick = function() {
weizhi1.value = ys1Value.enabled = true;
ys2Value.enabled = false;
};
weizhi2.onClick = function() {
weizhi2.value = ys2Value.enabled = true;
ys1Value.enabled = false;
};
weizhi3.onClick = function() {
weizhi3.value = ys3Value.enabled = true;
ys1Value.enabled = false;
};
weizhi4.onClick = function() {
weizhi4.value = ys4Value.enabled = true;
ys1Value.enabled = false;
};
weizhi5.onClick = function() {
weizhi5.value = ys5Value.enabled = true;
ys1Value.enabled = false;
};
weizhi0.onClick = function() {
weizhi0.value = ys0Value.enabled = true;
ys1Value.enabled = false;
};
yuzhiOK = regWin2.add("button", [135, 80, 215, 103], "确定", {
name: "ok"
});
yuzhiquziao = regWin2.add("button", [220, 80, 300, 103], "取消");
weizhi0.helpTip = "保存数据至面板常用";
weizhi1.helpTip = "保存数据至面板一";
weizhi2.helpTip = "保存数据至面板二";
weizhi3.helpTip = "保存数据至面板三";
weizhi4.helpTip = "保存数据至面板四";
weizhi5.helpTip = "保存数据至面板五";
yuzhiOK.helpTip = "确定请按回车键";
yuzhiquziao.helpTip = "取消请按Esc键";
yuzhiOK.onClick = function() {
if (weizhi1.value) {
gArgG = ys1;
} else if (weizhi2.value) {
gArgG = ys2;
} else if (weizhi3.value) {
gArgG = ys3;
} else if (weizhi4.value) {
gArgG = ys4;
} else if (weizhi5.value) {
gArgG = ys5;
} else if (weizhi0.value) {
gArgG = ys0;
} else {
gArgG = gArgG2 = gArgG3 = gArgG4 = gArgG5 = gArgG0;
}
function7();
function9();
regWin2.close();
};
yuzhiquziao.onClick = function() {
regWin2.close();
};
}
function function6() {
doc = activeDocument;
var layName = "角线图层";
try {
var cutlayer = doc.layers[layName];
cutlayer.locked = false;
cutlayer.visible = true;
} catch(err) {
var cutlayer = doc.layers.add();
cutlayer.name = layName;
}
g = cutlayer.groupItems.add();
regGroup = g.groupItems.add();
for (var i = 0; i < doc.spots.length; i += 1) {
if (doc.spots[i].typename == "Spot" && doc.spots[i].colorType == ColorModel.REGISTRATION) {
regColor = new SpotColor();
regColor.spot = doc.spots[i];
break;
}
}
theSelect = doc.selection;
if (theSelect.length == 0) {
doc.selectObjectsOnActiveArtboard();
theSelect = doc.selection;
}
lmin = theSelect[0].geometricBounds[0];
tmax = theSelect[0].geometricBounds[1];
lmax = theSelect[0].geometricBounds[2];
tmin = theSelect[0].geometricBounds[3];
if (bleeded2 == true) {
w1 = theSelect[0].width - (outspace * 2);
h1 = theSelect[0].height - (outspace * 2);
} else {
w1 = theSelect[0].width;
h1 = theSelect[0].height;
}
for (var i = 1; i < theSelect.length; i += 1) {
if (lmin > theSelect[i].geometricBounds[0]) {
lmin = theSelect[i].geometricBounds[0];
}
if (tmax < theSelect[i].geometricBounds[1]) {
tmax = theSelect[i].geometricBounds[1];
}
if (lmax < theSelect[i].geometricBounds[2]) {
lmax = theSelect[i].geometricBounds[2];
}
if (tmin > theSelect[i].geometricBounds[3]) {
tmin = theSelect[i].geometricBounds[3];
}
}
if (bleeded == true) {
lmin = lmin + outspace;
tmax = tmax - outspace;
lmax = lmax - outspace;
tmin = tmin + outspace;
}
if (onlyCTP.value == false) {
w = [];
for (var i = 0; i < theSelect.length; i += 1) {
if (bleeded2 == true) {
w.push(theSelect[i].geometricBounds[0] + outspace);
w.push(theSelect[i].geometricBounds[2] - outspace);
} else {
w.push(theSelect[i].geometricBounds[0]);
w.push(theSelect[i].geometricBounds[2]);
}
}
if (shuangjiaoxian == true) {
if (bleeded == true) {
w.push(lmin);
w.push(lmax);
w.push(lmin - outspace);
w.push(lmax + outspace);
} else {
w.push(lmin - outspace);
w.push(lmax + outspace);
}
}
ww = [];
for (var i = 0,
i2 = w.length; i < i2; i++) { ! RegExp(w[i], "g").test(ww.join(",")) && ww.push(w[i]);
}
Array.prototype.indexOf = function(pbc) {
for (var i = 0; i < this.length; i += 1) {
if (this[i] == pbc) {
return i;
}
}
return - 1;
};
Array.prototype.remove = function(ml) {
if (isNaN(ml) || ml > this.length) {
return false;
}
for (var i = 0,
kk = 0; i < this.length; i++) {
if (this[i] != this[ml]) {
this[kk++] = this[i];
}
}
this.length -= 1;
};
a = ww.indexOf(15279);
if (a == 0) {
ww.remove(a);
}
a = ww.indexOf( - 17487);
if (a == 0) {
ww.remove(a);
}
h = [];
for (var i = 0; i < theSelect.length; i += 1) {
if (bleeded2 == true) {
h.push(theSelect[i].geometricBounds[1] - outspace);
h.push(theSelect[i].geometricBounds[3] + outspace);
} else {
h.push(theSelect[i].geometricBounds[1]);
h.push(theSelect[i].geometricBounds[3]);
}
}
if (shuangjiaoxian == true) {
if (bleeded == true) {
h.push(tmax);
h.push(tmin);
h.push(tmax + outspace);
h.push(tmin - outspace);
} else {
h.push(tmax + outspace);
h.push(tmin - outspace);
}
}
hh = [];
for (var i = 0,
i2 = h.length; i < i2; i++) { ! RegExp(h[i], "g").test(hh.join(",")) && hh.push(h[i]);
}
a = hh.indexOf( - 1105);
if (a == 0) {
hh.remove(a);
}
a = hh.indexOf(31660);
if (a == 0) {
hh.remove(a);
}
if (oiValue.text != "") {
text = g.textFrames.add();
text.contents = oiValue.text + " ";
text.textRange.characterAttributes.textFont = Textfontname;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
text.rotate(90);
text.left = lmin - text.width - 7 - (py2Value.text * v);
text.top = tmin + text.height + (py3Value.text * v);
oiValueheight = text.height - 2;
} else {
oiValueheight = 0;
}
if (haveFN.value == true && havePT.value == true) {
docname = new File(doc.fullName).fsName;
} else {
if (haveFN.value == true) {
docname = "";
}
}
if (haveFN.value == true || haveTM.value == true) {
text = g.textFrames.add();
if (haveFN.value == true && haveTM.value == true) {
text.contents = docname;
}
text.textRange.characterAttributes.textFont = Textfontname;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
text.rotate( - 90);
text.left = lmax + text.width - fsValue.text + (py2Value.text * v) + 7;
text.top = tmax - (py3Value.text * v);
if (linespace > outspace) {
var jxq = linespace;
} else {
var jxq = outspace;
}
}
if (colormodul != 2) {
text = g.textFrames.add();
text.contents = "";
text.textRange.characterAttributes.textFont = Textfontname;
if (colormodul == 0) {
var jxo = 1;
if (boolC) {
text.contents = text.contents + "C";
}
if (boolM) {
text.contents = text.contents + "M";
}
if (boolY) {
text.contents = text.contents + "Y";
}
if (boolK) {
text.contents = text.contents + "K";
}
} else {
if (colormodul == 1) {
var jxo = 5;
if (boolC) {
text.contents = text.contents + "青色(C)";
}
if (boolM) {
text.contents = text.contents + "洋红(M)";
}
if (boolY) {
text.contents = text.contents + "黄色(Y)";
}
if (boolK) {
text.contents = text.contents + "黑色(K)";
}
}
}
for (var i = 0; i < doc.spots.length; i += 1) {
if (doc.spots[i].typename == "Spot" && doc.spots[i].colorType != ColorModel.REGISTRATION && doc.spots[i].colorType != ColorModel.PROCESS) {
spotName = doc.spots[i].name.replace("PANTONE ", ptRe);
spotName = spotName + " ";
text.contents = text.contents + spotName;
}
}
textl = 0;
colorArr = [];
if (boolC) {
c_Color = new CMYKColor();
c_Color.black = 0;
c_Color.cyan = 100;
c_Color.magenta = 0;
c_Color.yellow = 0;
colorArr.push(c_Color);
for (i = textl; i < (textl + jxo); i++) {
text.textRanges[i].characterAttributes.fillColor = c_Color;
text.textRanges[i].characterAttributes.stroked = false;
text.textRanges[i].characterAttributes.size = textfontsize;
}
textl = textl + jxo;
}
if (boolM) {
m_Color = new CMYKColor();
m_Color.black = 0;
m_Color.cyan = 0;
m_Color.magenta = 100;
m_Color.yellow = 0;
colorArr.push(m_Color);
for (i = textl; i < (textl + jxo); i++) {
text.textRanges[i].characterAttributes.fillColor = m_Color;
text.textRanges[i].characterAttributes.stroked = false;
text.textRanges[i].characterAttributes.size = textfontsize;
}
textl = textl + jxo;
}
if (boolY) {
y_Color = new CMYKColor();
y_Color.black = 0;
y_Color.cyan = 0;
y_Color.magenta = 0;
y_Color.yellow = 100;
colorArr.push(y_Color);
for (i = textl; i < (textl + jxo); i++) {
text.textRanges[i].characterAttributes.fillColor = y_Color;
text.textRanges[i].characterAttributes.stroked = false;
text.textRanges[i].characterAttributes.size = textfontsize;
}
textl = textl + jxo;
}
if (boolK) {
k_Color = new CMYKColor();
k_Color.black = 100;
k_Color.cyan = 0;
k_Color.magenta = 0;
k_Color.yellow = 0;
colorArr.push(k_Color);
for (i = textl; i < (textl + jxo); i++) {
text.textRanges[i].characterAttributes.fillColor = k_Color;
text.textRanges[i].characterAttributes.stroked = false;
text.textRanges[i].characterAttributes.size = textfontsize;
}
textl = textl + jxo;
}
for (var i = 0; i < doc.spots.length; i += 1) {
if (doc.spots[i].typename == "Spot" && doc.spots[i].colorType != ColorModel.REGISTRATION && doc.spots[i].colorType != ColorModel.PROCESS) {
Color = new SpotColor();
Color.spot = doc.spots[i];
colorArr.push(Color);
spotName = doc.spots[i].name.replace("PANTONE ", ptRe);
spotName = spotName + " ";
textl = textl + spotName.length;
for (var ow = 0; ow < spotName.length; ow += 1) {
text.textRanges[(textl - spotName.length) + ow].characterAttributes.fillColor = Color;
text.textRanges[(textl - spotName.length) + ow].characterAttributes.stroked = false;
text.textRanges[(textl - spotName.length) + ow].characterAttributes.size = textfontsize;
}
}
}
text.rotate(90);
text.left = lmin - text.width - 8.5 - (py2Value.text * v);
text.top = tmin + text.height + (py3Value.text * v) + oiValueheight;
OpacityArr = level.split(","); //色条开始
var jxwo = Math.ceil((lmax - lmin) / ((cw + cspace) * OpacityArr.length * colorArr.length));
var jxe = parseInt((lmax - lmin) / (cw + cspace)) - 1;
var oaVal = 0;
var jxkg = ((lmax - lmin) - ((cw + cspace) * jxe)) / 2;
temp = colorArr;
for (var i = 1; i < jxwo; i += 1) {
colorArr = colorArr.concat(temp);
}
if (colorLable.value == true) {
for (var i = 0; i < colorArr.length; i += 1) {
oaVal = OpacityArr.length * i;
if (i == 0) {
left = lmin + jxkg;
} else {
left = left + cw + cspace;
}
for (var ow = 0; ow < OpacityArr.length && oaVal < jxe; ow++, oaVal++) {
if (ow == 0) {
left = left;
} else {
left = left + cw + cspace;
}
if (linespace > outspace) {
var jxq = linespace + (py4Value.text * v); //色条上移
} else {
var jxq = outspace + (py4Value.text * v); //色条上移
}
rect = g.pathItems.rectangle(tmax + ch + jxq, left, cw, ch);
rect.filled = true;
rect.fillColor = colorArr[i];
rect.opacity = OpacityArr[ow];
rect.stroked = false;
}
}
}
} //色条结束
if (sbValue.text != "") { //自定义色条开始
link2file = g.placedItems.add();
link2file.file = new File(sbValue.text);
if ((lmax - lmin) < (tmax - tmin)) {
link2file.rotate(90);
link2file.left = lmin - link2file.width - 8.5 - (py5Value.text * v);
link2file.top = ((tmax + tmin) / 2) + (link2file.height / 2);
} else {
link2file.left = ((lmax + lmin) / 2) - ((link2file.width) / 2);
link2file.top = tmax + 8.5 + link2file.height + (py5Value.text * v);
}
if (embed.value == true) {
link2file.embed();
}
} //自定义色条结束
if (bite2.value == true) { //咬口上
text = g.textFrames.add();
text.contents = "咬 口";
text.textRange.characterAttributes.textFont = Textfontname;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
text.rotate(180);
text.left = ((lmax + lmin) / 2) - (text.width / 2);
text.top = tmax + (linelength / 2) + (text.height / 2) + 8.5;
}
if (bite3.value == true) { //左咬口
text = g.textFrames.add();
text.contents = "咬 口";
text.textRange.characterAttributes.textFont = Textfontname;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
text.rotate( - 90);
text.left = ((lmin - linespace) - (linelength / 2)) - (text.width / 2);
text.top = ((tmax + tmin) / 2) + (text.height / 2);
}
if (bite4.value == true) { //右咬口
text = g.textFrames.add();
text.contents = "咬 口";
text.textRange.characterAttributes.textFont = Textfontname;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
text.rotate(90);
text.left = (lmax + linespace + (linelength / 2)) - (text.width / 2);
text.top = ((tmax + tmin) / 2) + (text.height / 2);
}
if (bite.value == true) { //咬口下
text = g.textFrames.add();
text.contents = "咬 口";
text.textRange.characterAttributes.textFont = Textfontname;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
if ((lmax - lmin) < (tmax - tmin)) {
if (flagui.value == true) {
text.rotate( - 90);
text.left = ((lmin - linespace) - (linelength / 2)) - (text.width / 2);
text.top = ((tmax + tmin) / 2) + (text.height / 2);
} else {
text.rotate(0);
text.left = ((lmax + lmin) / 2) - (text.width / 2);
text.top = ((tmin - linespace) - (linelength / 2)) + (text.height / 2);
}
} else {
text.left = ((lmax + lmin) / 2) - (text.width / 2);
text.top = ((tmin - linespace) - (linelength / 2)) + (text.height / 2);
}
}
for (var i = 0; i < ww.length; i += 1) {
rg = regGroup.groupItems.add();
tPathVal = rg.pathItems.add();
tPathVal.strokeDashes = [];
if (shuangjiaoxian == true && rishicaiqie == true && outspace == linespace) {
if (ww[i] == (lmin - outspace) || ww[i] == (lmax + outspace)) {
tPathVal.setEntirePath([[ww[i], tmin], [ww[i], (tmin - linelength) - outspace]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.strokeDashes = [];
tPathVal.filled = false;
tPathVal = rg.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[ww[i], tmax], [ww[i], tmax + linelength + outspace]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
} else {
tPathVal.setEntirePath([[ww[i], tmin - linespace], [ww[i], (tmin - linespace) - linelength]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = rg.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[ww[i], tmax + linespace], [ww[i], tmax + linespace + linelength]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
}
} else {
tPathVal.setEntirePath([[ww[i], tmin - linespace], [ww[i], (tmin - linespace) - linelength]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = rg.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[ww[i], tmax + linespace], [ww[i], tmax + linespace + linelength]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
}
}
for (var i = 0; i < hh.length; i += 1) {
rg = regGroup.groupItems.add();
tPathVal = rg.pathItems.add();
tPathVal.strokeDashes = [];
if (shuangjiaoxian == true && rishicaiqie == true && outspace == linespace) {
if (hh[i] == (tmin - outspace) || hh[i] == (tmax + outspace)) {
tPathVal.setEntirePath([[lmin, hh[i]], [(lmin - linelength) - outspace, hh[i]]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = rg.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[lmax, hh[i]], [lmax + linelength + outspace, hh[i]]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
} else {
tPathVal.setEntirePath([[lmin - linespace, hh[i]], [(lmin - linespace) - linelength, hh[i]]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = rg.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[lmax + linespace, hh[i]], [lmax + linespace + linelength, hh[i]]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
}
} else {
tPathVal.setEntirePath([[lmin - linespace, hh[i]], [(lmin - linespace) - linelength, hh[i]]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = rg.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[lmax + linespace, hh[i]], [lmax + linespace + linelength, hh[i]]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
}
}
gr = g.groupItems.add();
tPathVal = gr.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[(lmin - linespace) - (linelength / 2) + ((gdValue.text * v) / 2) - (pyValue.text * v), tmax - ((tmax - tmin) / 2)], //左边高度
[(lmin - linespace) - (linelength / 2) - ((gdValue.text * v) / 2) - (pyValue.text * v), tmax - ((tmax - tmin) / 2)]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = gr.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[(lmin - linespace) - (linelength / 2) - (pyValue.text * v), (tmax - ((tmax - tmin) / 2)) + ((kdValue.text * v) / 2)], //左边宽度
[(lmin - linespace) - (linelength / 2) - (pyValue.text * v), (tmax - ((tmax - tmin) / 2)) - ((kdValue.text * v) / 2)]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = gr.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[(lmax + linespace) + (linelength / 2) + ((gdValue.text * v) / 2) + (pyValue.text * v), tmax - ((tmax - tmin) / 2)], //右边高度
[(lmax + linespace + linelength) - (linelength / 2) - ((gdValue.text * v) / 2) + (pyValue.text * v), tmax - ((tmax - tmin) / 2)]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = gr.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[lmax + linespace + (linelength / 2) + (pyValue.text * v), (tmax - ((tmax - tmin) / 2)) + (kdValue.text * v) / 2], //右边宽度
[lmax + linespace + (linelength / 2) + (pyValue.text * v), (tmax - ((tmax - tmin) / 2)) - (kdValue.text * v) / 2]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = gr.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[(lmin + ((lmax - lmin) / 2)) - (kdValue.text * v) / 2, tmax + linespace + (linelength / 2) + (pyValue.text * v)], //上边宽度
[lmin + ((lmax - lmin) / 2) + (kdValue.text * v) / 2, tmax + linespace + (linelength / 2) + (pyValue.text * v)]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = gr.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[lmin + ((lmax - lmin) / 2), (tmax + linespace) + (linelength / 2) + ((gdValue.text * v) / 2) + (pyValue.text * v)], //上边高度
[lmin + ((lmax - lmin) / 2), (tmax + linespace + linelength) - (linelength / 2) - ((gdValue.text * v) / 2) + (pyValue.text * v)]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = gr.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[(lmin + ((lmax - lmin) / 2)) - (kdValue.text * v) / 2, (tmin - linespace) - (linelength / 2) - (pyValue.text * v)], //下边宽度
[lmin + ((lmax - lmin) / 2) + (kdValue.text * v) / 2, (tmin - linespace) - (linelength / 2) - (pyValue.text * v)]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
tPathVal = gr.pathItems.add();
tPathVal.strokeDashes = [];
tPathVal.setEntirePath([[(lmin + ((lmax - lmin) / 2)), (tmin - linespace) - (linelength / 2) + ((gdValue.text * v) / 2) - (pyValue.text * v)], //下边高度
[(lmin + ((lmax - lmin) / 2)), ((tmin - linespace) - linelength) + (linelength / 2) - ((gdValue.text * v) / 2) - (pyValue.text * v)]]);
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = lw;
tPathVal.filled = false;
o = gr.pathItems.ellipse((tmax - ((tmax - tmin) / 2)) + (od / 2), ((lmin - (od / 2)) - linespace) - (linelength / 2) - (pyValue.text * v), od, od); //左边圆形
o.strokeColor = regColor;
o.strokeWidth = lw;
o.strokeDashes = [];
o.filled = false;
o = gr.pathItems.ellipse((tmax - ((tmax - tmin) / 2)) + (od / 2), (lmax - (od / 2)) + linespace + (linelength / 2) + (pyValue.text * v), od, od); //右边圆形
o.strokeColor = regColor;
o.strokeWidth = lw;
o.strokeDashes = [];
o.filled = false;
o = gr.pathItems.ellipse(tmax + linespace + (od / 2) + (linelength / 2) + (pyValue.text * v), (lmin + ((lmax - lmin) / 2)) - (od / 2), od, od); //上边圆形
o.strokeColor = regColor;
o.strokeWidth = lw;
o.strokeDashes = [];
o.filled = false;
o = gr.pathItems.ellipse(((tmin - linespace) + (od / 2)) - (linelength / 2) - (pyValue.text * v), (lmin + ((lmax - lmin) / 2)) - (od / 2), od, od); //下边圆形
o.strokeColor = regColor;
o.strokeWidth = lw;
o.strokeDashes = [];
o.filled = false;
if (wzzc.value == true) { //左侧信息开始
w = myDate();
if (haveFN.value == true && havePT.value == true) {
docname = new File(doc.fullName).fsName;
} else {
if (haveFN.value == true) {
docname = doc.name;
}
}
if (littleSize.value == true || bigSize.value == true || paperSize.value == true || paperSize1.value == true || haveFN.value == true || haveTM.value == true || weidong2.value == true) {
gw = g.width / v;
gh = g.height / v;
text = g.textFrames.add();
text.textRange.characterAttributes.textFont = Textfontname;
if (littleSize.value == true) {
text1 = "成品:" + Math.round(parseInt((w1 / 2.834646) * 100) / 100) + "x" + Math.round(parseInt((h1 / 2.834646) * 100) / 100) + "mm ";
} else {
text1 = "";
}
if (bigSize.value == true) {
text2 = "拼版:" + Math.round(parseInt(((lmax - lmin) / 2.834646) * 100) / 100) + "x" + Math.round(parseInt(((tmax - tmin) / 2.834646) * 100) / 100) + "mm ";
} else {
text2 = "";
}
if (paperSize.value == true) {
text3 = "角线:" + Math.round((gw * 100) / 100) + "x" + Math.round((gh * 100) / 100) + "mm ";
} else {
text3 = "";
}
if (paperSize1.value == true) {
text4 = "纸张:" + paperW.text + "x" + paperH.text + "mm ";
} else {
text4 = "";
}
if (haveFN.value == true) {
text5 = doc.name + " ";
} else {
text5 = "";
}
if (haveTM.value == true) {
text6 = w + " ";
} else {
text6 = "";
}
if (weidong2.text != "") {
text7 = weidong2.text + " ";
} else {
text7 = "";
}
text.contents = text5 + text6 + text7 + text1 + text2 + text3 + text4;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
text.rotate( - 90);
text.left = lmin - text.width - 8.5 - (py2Value.text * v);
text.top = tmax - (py3Value.text * v);
}
} else {} { // 左侧信息结束
}
if (wzzs.value == true) { //左上信息开始
w = myDate();
if (haveFN.value == true && havePT.value == true) {
docname = new File(doc.fullName).fsName;
} else {
if (haveFN.value == true) {
docname = doc.name;
}
}
if (littleSize.value == true || bigSize.value == true || paperSize.value == true || paperSize1.value == true || haveFN.value == true || haveTM.value == true || weidong2.value == true) {
gw = g.width / v;
gh = g.height / v;
text = g.textFrames.add();
text.textRange.characterAttributes.textFont = Textfontname;
if (littleSize.value == true) {
text1 = "成品:" + Math.round(parseInt((w1 / 2.834646) * 100) / 100) + "x" + Math.round(parseInt((h1 / 2.834646) * 100) / 100) + "mm ";
} else {
text1 = "";
}
if (bigSize.value == true) {
text2 = "拼版:" + Math.round(parseInt(((lmax - lmin) / 2.834646) * 100) / 100) + "x" + Math.round(parseInt(((tmax - tmin) / 2.834646) * 100) / 100) + "mm ";
} else {
text2 = "";
}
if (paperSize.value == true) {
text3 = "角线:" + Math.round((gw * 100) / 100) + "x" + Math.round((gh * 100) / 100) + "mm ";
} else {
text3 = "";
}
if (paperSize1.value == true) {
text4 = "纸张:" + paperW.text + "x" + paperH.text + "mm ";
} else {
text4 = "";
}
if (haveFN.value == true) {
text5 = doc.name + " ";
} else {
text5 = "";
}
if (haveTM.value == true) {
text6 = w + " ";
} else {
text6 = "";
}
if (weidong2.text != "") {
text7 = weidong2.text + " ";
} else {
text7 = "";
}
text.contents = text5 + text6 + text7 + text1 + text2 + text3 + text4;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
text.left = lmin + (py3Value.text * v);
text.top = tmax + 7 + text.height + (py2Value.text * v);
}
} else {} { //左上信息结束
}
if (wzzx.value == true) { // 左下信息开始
w = myDate();
if (haveFN.value == true && havePT.value == true) {
docname = new File(doc.fullName).fsName;
} else {
if (haveFN.value == true) {
docname = doc.name;
}
}
if (littleSize.value == true || bigSize.value == true || paperSize.value == true || paperSize1.value == true || haveFN.value == true || haveTM.value == true || weidong2.value == true) {
gw = g.width / v;
gh = g.height / v;
text = g.textFrames.add();
text.textRange.characterAttributes.textFont = Textfontname;
if (littleSize.value == true) {
text1 = "成品:" + Math.round(parseInt((w1 / 2.834646) * 100) / 100) + "x" + Math.round(parseInt((h1 / 2.834646) * 100) / 100) + "mm ";
} else {
text1 = "";
}
if (bigSize.value == true) {
text2 = "拼版:" + Math.round(parseInt(((lmax - lmin) / 2.834646) * 100) / 100) + "x" + Math.round(parseInt(((tmax - tmin) / 2.834646) * 100) / 100) + "mm ";
} else {
text2 = "";
}
if (paperSize.value == true) {
text3 = "角线:" + Math.round((gw * 100) / 100) + "x" + Math.round((gh * 100) / 100) + "mm ";
} else {
text3 = "";
}
if (paperSize1.value == true) {
text4 = "纸张:" + paperW.text + "x" + paperH.text + "mm ";
} else {
text4 = "";
}
if (haveFN.value == true) {
text5 = doc.name + " ";
} else {
text5 = "";
}
if (haveTM.value == true) {
text6 = w + " ";
} else {
text6 = "";
}
if (weidong2.text != "") {
text7 = weidong2.text + " ";
} else {
text7 = "";
}
text.contents = text5 + text6 + text7 + text1 + text2 + text3 + text4;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
text.left = lmin + (py3Value.text * v);
text.top = tmin - 8.5 - (py2Value.text * v);
}
} else {} { //左下信息结束
}
if (wzys.value == true) { //右上信息开始
w = myDate();
if (haveFN.value == true && havePT.value == true) {
docname = new File(doc.fullName).fsName;
} else {
if (haveFN.value == true) {
docname = doc.name;
}
}
if (littleSize.value == true || bigSize.value == true || paperSize.value == true || paperSize1.value == true || haveFN.value == true || haveTM.value == true || weidong2.value == true) {
gw = g.width / v;
gh = g.height / v;
text = g.textFrames.add();
text.textRange.characterAttributes.textFont = Textfontname;
if (littleSize.value == true) {
text1 = "成品:" + Math.round(parseInt((w1 / 2.834646) * 100) / 100) + "x" + Math.round(parseInt((h1 / 2.834646) * 100) / 100) + "mm ";
} else {
text1 = "";
}
if (bigSize.value == true) {
text2 = "拼版:" + Math.round(parseInt(((lmax - lmin) / 2.834646) * 100) / 100) + "x" + Math.round(parseInt(((tmax - tmin) / 2.834646) * 100) / 100) + "mm ";
} else {
text2 = "";
}
if (paperSize.value == true) {
text3 = "角线:" + Math.round((gw * 100) / 100) + "x" + Math.round((gh * 100) / 100) + "mm ";
} else {
text3 = "";
}
if (paperSize1.value == true) {
text4 = "纸张:" + paperW.text + "x" + paperH.text + "mm ";
} else {
text4 = "";
}
if (haveFN.value == true) {
text5 = doc.name + " ";
} else {
text5 = "";
}
if (haveTM.value == true) {
text6 = w + " ";
} else {
text6 = "";
}
if (weidong2.text != "") {
text7 = weidong2.text + " ";
} else {
text7 = "";
}
text.contents = text5 + text6 + text7 + text1 + text2 + text3 + text4;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
text.left = lmax - text.width + 8.5 - (py3Value.text * v);
text.top = tmax + 7 + text.height + (py2Value.text * v);
}
} else {} { //右上信息结束
}
if (wzyc.value == true) { // 右侧信息开始
w = myDate();
if (haveFN.value == true && havePT.value == true) {
docname = new File(doc.fullName).fsName;
} else {
if (haveFN.value == true) {
docname = doc.name;
}
}
if (littleSize.value == true || bigSize.value == true || paperSize.value == true || paperSize1.value == true || haveFN.value == true || haveTM.value == true || weidong2.value == true) {
gw = g.width / v;
gh = g.height / v;
text = g.textFrames.add();
text.textRange.characterAttributes.textFont = Textfontname;
if (littleSize.value == true) {
text1 = "成品:" + Math.round(parseInt((w1 / 2.834646) * 100) / 100) + "x" + Math.round(parseInt((h1 / 2.834646) * 100) / 100) + "mm ";
} else {
text1 = "";
}
if (bigSize.value == true) {
text2 = "拼版:" + Math.round(parseInt(((lmax - lmin) / 2.834646) * 100) / 100) + "x" + Math.round(parseInt(((tmax - tmin) / 2.834646) * 100) / 100) + "mm ";
} else {
text2 = "";
}
if (paperSize.value == true) {
text3 = "角线:" + Math.round((gw * 100) / 100) + "x" + Math.round((gh * 100) / 100) + "mm ";
} else {
text3 = "";
}
if (paperSize1.value == true) {
text4 = "纸张:" + paperW.text + "x" + paperH.text + "mm ";
} else {
text4 = "";
}
if (haveFN.value == true) {
text5 = doc.name + " ";
} else {
text5 = "";
}
if (haveTM.value == true) {
text6 = w + " ";
} else {
text6 = "";
}
if (weidong2.text != "") {
text7 = weidong2.text + " ";
} else {
text7 = "";
}
text.contents = text5 + text6 + text7 + text1 + text2 + text3 + text4;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
text.rotate(90);
text.left = lmax + text.width - fsValue.text + (py2Value.text * v) + 7;
text.top = tmin + text.height + (py3Value.text * v);
}
} else {} { //右侧信息结束
}
if (wzyx.value == true) { // 右下信息开始
w = myDate();
if (haveFN.value == true && havePT.value == true) {
docname = new File(doc.fullName).fsName;
} else {
if (haveFN.value == true) {
docname = doc.name;
}
}
if (littleSize.value == true || bigSize.value == true || paperSize.value == true || paperSize1.value == true || haveFN.value == true || haveTM.value == true || weidong2.value == true) {
gw = g.width / v;
gh = g.height / v;
text = g.textFrames.add();
text.textRange.characterAttributes.textFont = Textfontname;
if (littleSize.value == true) {
text1 = "成品:" + Math.round(parseInt((w1 / 2.834646) * 100) / 100) + "x" + Math.round(parseInt((h1 / 2.834646) * 100) / 100) + "mm ";
} else {
text1 = "";
}
if (bigSize.value == true) {
text2 = "拼版:" + Math.round(parseInt(((lmax - lmin) / 2.834646) * 100) / 100) + "x" + Math.round(parseInt(((tmax - tmin) / 2.834646) * 100) / 100) + "mm ";
} else {
text2 = "";
}
if (paperSize.value == true) {
text3 = "角线:" + Math.round((gw * 100) / 100) + "x" + Math.round((gh * 100) / 100) + "mm ";
} else {
text3 = "";
}
if (paperSize1.value == true) {
text4 = "纸张:" + paperW.text + "x" + paperH.text + "mm ";
} else {
text4 = "";
}
if (haveFN.value == true) {
text5 = doc.name + " ";
} else {
text5 = "";
}
if (haveTM.value == true) {
text6 = w + " ";
} else {
text6 = "";
}
if (weidong2.text != "") {
text7 = weidong2.text + " ";
} else {
text7 = "";
}
text.contents = text5 + text6 + text7 + text1 + text2 + text3 + text4;
text.textRange.characterAttributes.fillColor = regColor;
text.textRange.characterAttributes.stroked = false;
text.textRange.characterAttributes.size = textfontsize;
text.left = lmax - text.width + 8.5 - (py3Value.text * v);
text.top = tmin - 8.5 - (py2Value.text * v);
}
}
} else {} { //右下信息结束
}
if (zlagui.value == true || flagui.value == true) {
if (sfValue.text != "") {
linkfile = g.placedItems.add();
linkfile.file = new File(sfValue.text);
} else {
if (zlagui.value == true) {
linkpdf = "Lagui_z.pdf";
} else {
linkpdf = "Lagui_f.pdf";
}
laguifile = new File(set_folder + linkpdf);
if (laguifile.exists) {
linkfile = g.placedItems.add();
linkfile.file = laguifile;
} else {
return false;
}
}
if (zlagui.value == true) {
if ((lmax - lmin) < (tmax - tmin)) {
linkfile.rotate(90);
linkfile.left = (lmax - linkfile.width) - ((lmValue.text - 0) * v);
linkfile.top = tmax + linkfile.height + 8.5 + (lm2Value.text * v); //正拉规左右偏移
} else {
linkfile.left = lmax + 8.5 + (lm2Value.text * v); //正拉规左右偏移
linkfile.top = tmin + linkfile.height + ((lmValue.text - 0) * v);
}
} else {
if ((lmax - lmin) < (tmax - tmin)) {
linkfile.rotate( - 90);
linkfile.left = lmin + ((lmValue.text - 0) * v);
linkfile.top = tmax + linkfile.height + 8.5 + (lm2Value.text * v); //反拉规左右偏移
} else {
linkfile.left = lmin - 8.5 - linkfile.width - (lm2Value.text * v); //反拉规左右偏移
linkfile.top = tmin + linkfile.height + ((lmValue.text - 0) * v);
}
}
if (embed.value == true) {
linkfile.embed();
}
}
if (ABtrans.value == true || gird.value == true) {
g1 = cutlayer.groupItems.add();
}
lmin = lmin + qubian;
tmax = tmax - qubian;
lmax = lmax - qubian;
tmin = tmin + qubian;
if (autopage.value == false && ABtrans.value == true) {
Ab = doc.artboards[doc.artboards.getActiveArtboardIndex()];
refB = [lmin, tmax, lmax, tmin];
refB_width = refB[2] - refB[0];
refB_heigth = refB[1] - refB[3];
var yVal = refB[0] - ((Paper_width - refB_width) / 2);
var xVal = refB[1] + ((Paper_heigth - refB_heigth) - Paper_bite);
paper = g1.pathItems.rectangle(xVal, yVal, Paper_width, Paper_heigth);
paper.filled = false;
paper.stroked = true;
paper.strokeColor = new CMYKColor();
paper.strokeColor.black = py14Value.text;
paper.strokeColor.cyan = py11Value.text;
paper.strokeColor.magenta = py12Value.text;
paper.strokeColor.yellow = py13Value.text;
paper.strokeWidth = py21Value.text;
refB[0] = refB[0] - ((Plate_width - refB_width) / 2);
refB[2] = refB[2] + ((Plate_width - refB_width) / 2);
refB[1] = refB[1] + ((Plate_heigth - refB_heigth) - Plate_bite);
refB[3] = refB[3] - Plate_bite;
Ab.artboardRect = refB;
}
if (autopage.value == false && gird.value == true) {
var arrayVal = [];
arrayVal[0] = [[ - 66666, tmin], [66666, tmin]];
arrayVal[1] = [[ - 66666, tmin - Paper_bite], [66666, tmin - Paper_bite]];
arrayVal[2] = [[(lmin + lmax) / 2, 66666], [(lmin + lmax) / 2, -66666]];
arrayVal[3] = [[ - 66666, tmin - Plate_bite], [66666, tmin - Plate_bite]];
for (var i = 0; i < arrayVal.length; i += 1) {
var tPathVal = g1.pathItems.add();
tPathVal.setEntirePath(arrayVal[i]);
tPathVal.filled = false;
tPathVal.stroked = true;
tPathVal.strokeColor = regColor;
tPathVal.strokeWidth = 1;
tPathVal.strokeDashes = [5, 1, 1];
tPathVal.guides = true;
tPathVal.locked = true;
}
}
if (autopage.value == true) {
Ab = doc.artboards[doc.artboards.getActiveArtboardIndex()];
Ab.artboardRect = g.geometricBounds;
}
if (scValue.text != "") { //自定义测控条开始
link3file = g.placedItems.add();
link3file.file = new File(scValue.text);
link3file.left = ((lmax + lmin) / 2) - ((link3file.width) / 2);
link3file.top = tmin - 8.5 - (py6Value.text * v);
}
if (embed.value == true) {
link3file.embed();
} //自定义测控条结束
}
function myDate() {
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth() + 1;
var date = now.getDate();
if (month < 10) {
month = "0" + month;
}
if (date < 10) {
date = "0" + date;
}
time = year + "-" + month + "-" + date;
return time;
}
function function3(modeVal, gArgG, fileReadVal) {
var NewFileVal = new File(gArgG);
NewFileVal.lineFeed = "Windows";
if (modeVal == "read") {
NewFileVal.open("r");
var fileReadVal = NewFileVal.read();
return fileReadVal;
}
if (modeVal == "write") {
NewFileVal.open("w", "TEXT", "????");
NewFileVal.write(fileReadVal);
NewFileVal.close();
}
}
function function8() {
NewFileVal = new File(gArgG);
if (NewFileVal.exists == true) {
AutoMarkinfo = function3("read", filePath, filename);
AutoMarkXml = new XML(AutoMarkinfo);
}
}
function function10() {
NewFileVal = new File(Preset);
PresetXml = new XML("<Preset></Preset>");
PresetXml.ys0Value = "常用";
PresetXml.ys1Value = "预设一";
PresetXml.ys2Value = "预设二";
PresetXml.ys3Value = "预设三";
PresetXml.ys4Value = "预设四";
PresetXml.ys5Value = "预设五";
Contents = PresetXml;
function3("write", Preset, Contents);
}
function function9() {
PresetXml.ys0Value = ys0Value.text;
PresetXml.ys1Value = ys1Value.text;
PresetXml.ys2Value = ys2Value.text;
PresetXml.ys3Value = ys3Value.text;
PresetXml.ys4Value = ys4Value.text;
PresetXml.ys5Value = ys5Value.text;
Contents = PresetXml;
function3("write", Preset, Contents);
}
function function2() {
NewFileVal = new File(gArgG);
AutoMarkXml = new XML("<AutoMark></AutoMark>");
AutoMarkXml.lLValue = 9;
AutoMarkXml.lwValue = 0.1;
AutoMarkXml.lSValue = 3;
AutoMarkXml.oSValue = 3;
AutoMarkXml.doubleLine = 1;
AutoMarkXml.JPLine = 1;
AutoMarkXml.zlagui = 0;
AutoMarkXml.flagui = 0;
AutoMarkXml.buhanchuxue = 1;
AutoMarkXml.quanbuchuxue = 0;
AutoMarkXml.dabanchuxue = 0;
AutoMarkXml.CMYK = 1;
AutoMarkXml.mingcheng = 0;
AutoMarkXml.wu = 0;
AutoMarkXml.colorLable = 0;
AutoMarkXml.boolCx = 1;
AutoMarkXml.boolMx = 1;
AutoMarkXml.boolYx = 1;
AutoMarkXml.boolKx = 1;
AutoMarkXml.prValue = "";
AutoMarkXml.haveFN = 1;
AutoMarkXml.haveTM = 1;
AutoMarkXml.havePT = 0;
AutoMarkXml.littleSize = 0;
AutoMarkXml.bigSize = 1;
AutoMarkXml.paperSize = 0;
AutoMarkXml.paperSize1 = 0;
AutoMarkXml.bite = 1;
AutoMarkXml.bite2 = 0;
AutoMarkXml.bite3 = 0;
AutoMarkXml.bite4 = 0;
AutoMarkXml.oiValue = "";
AutoMarkXml.paperW = 0;
AutoMarkXml.paperH = 0;
AutoMarkXml.paperB = 0;
AutoMarkXml.platoW = 650;
AutoMarkXml.platoH = 550;
AutoMarkXml.platoB = 60;
AutoMarkXml.cxdbkuang = 0;
AutoMarkXml.autopage = 0;
AutoMarkXml.ABtrans = 0;
AutoMarkXml.gird = 0;
AutoMarkXml.onlyCTP = 0;
AutoMarkXml.sfValue = "";
AutoMarkXml.sbValue = "";
AutoMarkXml.scValue = "";
AutoMarkXml.lmValue = 110;
AutoMarkXml.lm2Value = 0;
AutoMarkXml.embed = 1;
AutoMarkXml.fnValue = "微软雅黑";
AutoMarkXml.fsValue = 12;
AutoMarkXml.chValue = 5;
AutoMarkXml.cwValue = 5;
AutoMarkXml.rdValue = 3;
AutoMarkXml.kdValue = 20;
AutoMarkXml.gdValue = 6;
AutoMarkXml.pyValue = 0;
AutoMarkXml.py2Value = 0;
AutoMarkXml.py3Value = 5;
AutoMarkXml.py4Value = 0;
AutoMarkXml.py5Value = 0;
AutoMarkXml.py6Value = 15;
AutoMarkXml.py11Value = 0;
AutoMarkXml.py12Value = 0;
AutoMarkXml.py13Value = 0;
AutoMarkXml.py14Value = 100;
AutoMarkXml.py21Value = 0.25;
AutoMarkXml.csValue = 0;
AutoMarkXml.clValue = "20,40,60,80,100";
Contents = AutoMarkXml;
AutoMarkXml.szjsl1 = "";
AutoMarkXml.szjsl2 = "";
AutoMarkXml.szjsl3 = "";
AutoMarkXml.szjsl4 = "";
AutoMarkXml.szjsl5 = "";
AutoMarkXml.weidong2 = "";
AutoMarkXml.wzzc = 0;
AutoMarkXml.wzzs = 0;
AutoMarkXml.wzzx = 0;
AutoMarkXml.wzys = 0;
AutoMarkXml.wzyx = 0;
AutoMarkXml.wzyc = 1;
AutoMarkXml.note1 = "";
AutoMarkXml.note2 = "";
function3("write", gArgG, Contents);
}
function function7() {
AutoMarkXml.lLValue = lLValue.text;
AutoMarkXml.lwValue = lwValue.text;
AutoMarkXml.lSValue = lSValue.text;
AutoMarkXml.oSValue = oSValue.text;
AutoMarkXml.doubleLine = doubleLine.value - 0;
AutoMarkXml.JPLine = JPLine.value - 0;
AutoMarkXml.zlagui = zlagui.value - 0;
AutoMarkXml.flagui = flagui.value - 0;
AutoMarkXml.buhanchuxue = buhanchuxue.value - 0;
AutoMarkXml.quanbuchuxue = quanbuchuxue.value - 0;
AutoMarkXml.dabanchuxue = dabanchuxue.value - 0;
AutoMarkXml.CMYK = CMYK.value - 0;
AutoMarkXml.mingcheng = mingcheng.value - 0;
AutoMarkXml.wu = wu.value - 0;
AutoMarkXml.colorLable = colorLable.value - 0;
AutoMarkXml.boolCx = boolCx.value - 0;
AutoMarkXml.boolMx = boolMx.value - 0;
AutoMarkXml.boolYx = boolYx.value - 0;
AutoMarkXml.boolKx = boolKx.value - 0;
AutoMarkXml.prValue = prValue.text;
AutoMarkXml.haveFN = haveFN.value - 0;
AutoMarkXml.haveTM = haveTM.value - 0;
AutoMarkXml.havePT = havePT.value - 0;
AutoMarkXml.littleSize = littleSize.value - 0;
AutoMarkXml.bigSize = bigSize.value - 0;
AutoMarkXml.paperSize = paperSize.value - 0;
AutoMarkXml.paperSize1 = paperSize1.value - 0;
AutoMarkXml.bite = bite.value - 0;
AutoMarkXml.bite2 = bite2.value - 0;
AutoMarkXml.bite3 = bite3.value - 0;
AutoMarkXml.bite4 = bite4.value - 0;
AutoMarkXml.oiValue = oiValue.text;
AutoMarkXml.paperW = paperW.text - 0;
AutoMarkXml.paperH = paperH.text - 0;
AutoMarkXml.paperB = paperB.text - 0;
AutoMarkXml.platoW = platoW.text - 0;
AutoMarkXml.platoH = platoH.text - 0;
AutoMarkXml.platoB = platoB.text - 0;
AutoMarkXml.cxdbkuang = cxdbkuang.text - 0;
AutoMarkXml.autopage = autopage.value - 0;
AutoMarkXml.ABtrans = ABtrans.value - 0;
AutoMarkXml.gird = gird.value - 0;
AutoMarkXml.onlyCTP = onlyCTP.value - 0;
AutoMarkXml.sfValue = sfValue.text;
AutoMarkXml.sbValue = sbValue.text;
AutoMarkXml.scValue = scValue.text;
AutoMarkXml.lmValue = lmValue.text;
AutoMarkXml.lm2Value = lm2Value.text;
AutoMarkXml.embed = embed.value - 0;
AutoMarkXml.fnValue = fnValue.text;
AutoMarkXml.fsValue = fsValue.text;
AutoMarkXml.chValue = chValue.text;
AutoMarkXml.cwValue = cwValue.text;
AutoMarkXml.rdValue = rdValue.text;
AutoMarkXml.kdValue = kdValue.text;
AutoMarkXml.gdValue = gdValue.text;
AutoMarkXml.pyValue = pyValue.text;
AutoMarkXml.py2Value = py2Value.text;
AutoMarkXml.py3Value = py3Value.text;
AutoMarkXml.py4Value = py4Value.text;
AutoMarkXml.py5Value = py5Value.text;
AutoMarkXml.py6Value = py6Value.text;
AutoMarkXml.py11Value = py11Value.text;
AutoMarkXml.py12Value = py12Value.text;
AutoMarkXml.py13Value = py13Value.text;
AutoMarkXml.py14Value = py14Value.text;
AutoMarkXml.py21Value = py21Value.text;
AutoMarkXml.csValue = csValue.text;
AutoMarkXml.clValue = clValue.text;
Contents = AutoMarkXml;
AutoMarkXml.szjsl1 = szjsl1.text;
AutoMarkXml.szjsl2 = szjsl2.text;
AutoMarkXml.szjsl3 = szjsl3.text;
AutoMarkXml.szjsl4 = szjsl4.text;
AutoMarkXml.szjsl5 = szjsl5.text;
AutoMarkXml.weidong2 = weidong2.text;
AutoMarkXml.wzzc = wzzc.value - 0;
AutoMarkXml.wzzs = wzzs.value - 0;
AutoMarkXml.wzzx = wzzx.value - 0;
AutoMarkXml.wzys = wzys.value - 0;
AutoMarkXml.wzyx = wzyx.value - 0;
AutoMarkXml.wzyc = wzyc.value - 0;
AutoMarkXml.note1 = note1.text;
AutoMarkXml.note2 = note2.text;
function3("write", gArgG, Contents);
}
function checkSetFolder() {
var $folder = new Folder(set_folder);
if (!$folder.exists) {
$folder.create();
}
}
function1();
Adobe Illustrator【印前角线X2.0】脚本源码相关推荐
- bat脚本保存dir结果_Tomcat的启停脚本源码解析
作者 | 程序员自由之路 来源 | cnblogs.com/54chensongxia/p/13234398.html Tomcat的启停脚本源码解析 Tomcat是一款我们平时开发过程中最常用到的S ...
- 分析一个Auto.js写的抖音抢福袋脚本源码
今天分享一个自用的抖音抢福袋脚本源码,自动进入直播间抢福袋,彻底解放双手,对技术感兴趣的朋友可以看一下核心源码,自己也可以试着写一下. (function(_0x83958c, _0xc60544, ...
- 贴吧顶贴php脚步,【技术贴安卓按键精灵】贴吧顶贴脚本源码分享
贴吧顶贴脚本源码分享 配置介绍:模拟器:雷电模拟器 480*800 dpi 160 按键精灵手机助手 涉及的图片有两张: 注意事项:每次发布3-5条,之后时间间隔不低于20分钟,单账号一天不要发布太 ...
- autojs写脚本:天启app脚本源码
autojs写脚本:天启app脚本源码 个人保存而已. 源码中涉及到广告关闭.控件点击等函数.自己使用的. 需要的话需付费.不免费. 如果真有心,想学,源码中的编写脚本的逻辑等完全够用. var 日常 ...
- 【按键精灵源码分享】遍历图片在屏幕上出现的所有坐标脚本源码
大家好,我是公众号3分钟学堂的郭立员,今天继续我们的按键精灵安卓版源码分享,这一期带来的是遍历图片在屏幕上出现的所有坐标脚本源码. 适用范围 同一张图在屏幕上多次出现,比如下面这些图. 图片 图片 代 ...
- 虚幻竞技场脚本源码V1.2公布
虚幻竞技场脚本源码V1.2公布 UnrealScript基本上包含了UT的全部功能,对于学习和MOD制作都有很好的参考价值. http://udn.epicgames.com/Files/UT3/M. ...
- KinhDown注入截取解密后的Lua脚本源码
KinhDown桌面端测试版中加入了通过执行Lua脚本获取满速百度网盘下载链接的功能: 其Lua脚本在TG频道里更新,但拿到的均为加密后的Lua脚本,KinhDown会在私钥解密后执行Lua脚本.不过 ...
- PHP在线考试系统4.0版本源码电脑+手机端
PHP在线考试系统的功能与优点: 1.强化训练测验,对知识点进行单独联系 : 2.随机组卷练习,系统自动抽取题目进行练习 : 3.手工组卷联系,通过教师平台手工组卷形成考卷进行模拟练习 : 4.支持主 ...
- 代练工作室php源码,PHP开发的代练系统V2.0版本源码 附带搭建和对接支付视频
PHP开发的代练系统V2.0版本源码 附带搭建和对接支付视频 1/ 修改DB数据库MYSQL连接配置文件 /Public_Menglenet/A/Common/Conf/Config.php 内的数据 ...
- python传奇自动打怪脚本_易语言传奇sf自动打怪脚本源码
從目前的傳奇推出的新地圖來看,闖赤月殺蜘蛛還是很刺激的.特別是像我這樣的老玩家,在傳奇中混了很長一段時間了,殺一些簡單的怪,已經很乏味了.好不容易出了新地圖,總不可能放過吧,但大家也別小看了這些蜘蛛哦 ...
最新文章
- 『转』数据库的委托之类型分类处理
- 2020年最具“钱途”的编程语言
- 用于实现 Web 服务的 SOA 编程模型,第 10 部分: SOA 用户角色
- 陈年佳酿之 - Winform ListView 控件 double click 事件中获取选中的row与column
- (三)比特币时间序列数据的AI异常检测
- 如何对付vc6的疑难杂症
- 尝试用LoadRunner录制单机程序--未生成录制脚本
- 敏捷思维-架构设计中的方法学(12)Refactoring
- 一些常用的css小技巧
- 迈信EP100伺服驱动器量产型修改bug全套C源代码和硬件
- 学生端极域课堂万能密码
- 【洛谷刷题笔记】P4093 [HEOI2016/TJOI2016] 序列
- html折线图坐标轴怎么设置,Excel折线图怎么设置坐标轴起点不为0
- 企业思想家:专家详解元宇宙逻辑和产业机会 (5000余字)
- mysql左右匹配原则的用法和理解
- 面向对象:编程范式、类、对象
- Tensorflow应用之LSTM
- matlab2阶系统,基于Matlab/Simulink的二阶控制系统仿真研究
- NOIP模拟试题2021/11/11
- Java毕设项目学生二手书籍交易平台计算机(附源码+系统+数据库+LW)
热门文章
- iOS应用审核 - Phased Release for Automatic Updates (阶段性自动更新发布)
- 购买台式计算机的群体,电脑市场定位和目标消费者分析
- unity自动生成敌人_unity 2d AI 敌人 自动追踪(1)
- 07-图4 哈利·波特的考试(25 分)
- DoublyLinkedList
- 手写SSH2服务器连接池
- 短文阅读1:Entire Space Multi-Task Model: An Effective Approach for Estimating Post-Click Conversion Rate
- WSJ0中的wv文件如何转换为wav文件
- 【踩坑记录】.bss段;.bss段到底占不占目标文件的空间,有没有记录对应信息。
- 深圳市计算机素质测试答案,广东 : 2019年深圳计算机专业素质测试真题