- 精华
- 活跃值
-
- 积分
- 714
- 违规
-
- 印币
-
- 鲜花值
-
- 在线时间
- 小时
累计签到:86 天 连续签到:1 天
|
发表于 2024-1-26 08:36:36
|
显示全部楼层
Error 1200: an Illustrator error occurred: 1346458189 ('PARM')
Line: 1
-> var scriptName="AutoMark";var v=1;var Ver="V1.0";var myAns=new Array();var set_folder=Folder.myDocuments+"/【极速拼版V1.0】数据文件/"+scriptName+"/";gArgG=gArgG0=gArgG2=gArgG3=gArgG4=gArgG5=set_folder+scriptName+"_"+Ver+".xml";ys0=set_folder+"AutoMark_0.xml";ys1=set_folder+"AutoMark_1.xml";ys2=set_folder+"AutoMark_2.xml";ys3=set_folder+"AutoMark_3.xml";ys4=set_folder+"AutoMark_4.xml";ys5=set_folder+"AutoMark_5.xml"reset=set_folder+"reset.xml";checkSetFolder();function function1(a,b,c,d){NewFileVal=new File(gArgG);if(NewFileVal.exists==false){function2()}PresetFile=new File(Preset);if(PresetFile.exists==false){function10()}Presetinfo=function3("read",Preset)resetXml=new XML(Presetinfo);AutoMarkinfo=function3("read",gArgG);AutoMarkXml=new XML(AutoMarkinfo);regWin=new Window("dialog","极速拼版V1.0",[0,0,285,340],{resizeable:true,resizeable:false});spfx=regWin.add("panel",[10,10,275,225]);zdong=spfx.add("radiobutton",[10,13,120,28],"自动拼版");zdong.helpTip="〖自动拼版〗选项\n读取〖水平自动〗和〖垂直自动〗数据";zdong.value=AutoMarkXml.zdong-0;sdong=spfx.add("radiobutton",[140,13,250,28],"手动拼版");sdong.helpTip="〖手动拼版〗选项\n读取〖水平数量〗和〖垂直数量〗数据";sdong.value=AutoMarkXml.sdong-0;spjs_w=spfx.add("statictext",[10,38,80,53],"水平自动:");spjs=spfx.add("statictext",[75,38,120,53],b);spcf_w=spfx.add("statictext",[10,63,80,78],"水平数量:");spcf=spfx.add("edittext",[70,60,120,80],AutoMarkXml.spcf);sppy_w=spfx.add("statictext",[10,88,80,103],"水平间距:");sppy=spfx.add("edittext",[70,85,120,105],AutoMarkXml.sppy);czjs_w=spfx.add("statictext",[140,38,210,53],"垂直自动:");czjs=spfx.add("statictext",[205,38,250,53],d);czcf_w=spfx.add("statictext",[140,63,210,78],"垂直数量:");czcf=spfx.add("edittext",[200,60,250,80],AutoMarkXml.czcf);czpy_w=spfx.add("statictext",[140,88,210,103],"垂直间距:");czpy=spfx.add("edittext",[200,85,250,105],AutoMarkXml.czpy);xtiao1=spfx.add("panel",[10,116,250,118]);scjx=spfx.add("dropdownlist",[10,130,120,150],["裁切线","裁切线-无","裁切线-页面","-","说明:[裁切模式]选项↑"]);scjx.helpTip="[1]生成套版色裁切线\n[2]不生成裁切线\n[3]裁切线适合页面边界";scjx.selection=AutoMarkXml.scjx-0;jxcd_w=spfx.add("statictext",[10,158,80,173],"裁切长度:");cqcd=spfx.add("edittext",[70,155,120,175],AutoMarkXml.cqcd);jxcx_w=spfx.add("statictext",[10,183,80,198],"裁切粗细:");cqcx=spfx.add("edittext",[70,180,120,200],AutoMarkXml.cqcx);chuxms=spfx.add("dropdownlist",[140,130,250,150],["不含出血","全部出血","-","说明:[出血模式]选项↑"]);chuxms.helpTip="[1]生成1根裁切线\n[2]生成2根裁切线\ ";chuxms.selection=AutoMarkXml.chuxms-0;jxpy_w=spfx.add("statictext",[140,158,210,173],"裁切出血:");cqcc=spfx.add("edittext",[200,155,250,175],AutoMarkXml.cqcc);jxpy_w=spfx.add("statictext",[140,183,210,198],"裁切偏移:");cqpy=spfx.add("edittext",[200,180,250,200],AutoMarkXml.cqpy);yushe0=regWin.add("button",[20,235,98.33,255],PresetXml.ys1Value);yushe0.helpTip="读取预设〖1〗数据";yushe2=regWin.add("button",[103.33,235,181.66,255],PresetXml.ys2Value);yushe2.helpTip="读取预设〖2〗数据";yushe3=regWin.add("button",[186.66,235,265,255],PresetXml.ys3Value);yushe3.helpTip="读取预设〖3〗数据";yushe4=regWin.add("button",[20,260,98.33,280],PresetXml.ys4Value);yushe4.helpTip="读取预设〖4〗数据";yushe5=regWin.add("button",[103.33,260,181.66,280],PresetXml.ys5Value);yushe5.helpTip="读取预设〖5〗数据";yushe1=regWin.add("button",[186.66,260,265,280],PresetXml.ys0Value);yushe1.helpTip="读取预设〖常用〗数据";shezhi=regWin.add("button",[20,298,60,322],"设置");shezhi.helpTip="设置保存预设数据";okBt=regWin.add("button",[103.33,298,181.66,322],"确定",{name:"ok"});okBt.helpTip="确定请按回车键";cancleBt=regWin.add("button",[186.66,298,265,322],"取消",{name:"cancel"});cancleBt.helpTip="取消请按Esc键";regWin.center();cancleBt.onClick=function(){myAns.cancel=true;regWin.close();return};shezhi.onClick=function(){function4();regWin2.center();regWin2.show()};yushe0.onClick=function(){gArgG=ys0;NewFileVal=new File(gArgG);if(NewFileVal.exists==false){alert("输入数据点击〖设置〗,〖保存位置〗〖1〗〖保存〗!")}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("输入数据点击〖设置〗,〖保存位置〗〖2〗〖保存〗!")}else{regWin.close();function1()}};yushe3.onClick=function(){gArgG=ys3;NewFileVal=new File(gArgG);if(NewFileVal.exists==false){alert("输入数据点击〖设置〗,〖保存位置〗〖3〗〖保存〗!")}else{regWin.close();function1()}};yushe4.onClick=function(){gArgG=ys4;NewFileVal=new File(gArgG);if(NewFileVal.exists==false){alert("输入数据点击〖设置〗,〖保存位置〗〖4〗〖保存〗!")}else{regWin.close();function1()}};yushe5.onClick=function(){gArgG=ys5;NewFileVal=new File(gArgG);if(NewFileVal.exists==false){alert("输入数据点击〖设置〗,〖保存位置〗〖5〗〖保存〗!")}else{regWin.close();function1()}};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()}u=2.83466796875;lw=cqcx.text*u;cd=cqcd.text*u;cx=cqpy.text*u;cc=cqcc.text*u;if(zdong.value==true){zdsdX=b;zdsdY=d}else{zdsdX=AutoMarkXml.spcf;zdsdY=AutoMarkXml.czcf}myAns.cancel=false;myAns.xcount=parseInt(zdsdX);myAns.xoffset=(parseFloat(sppy.text)+a)*v;myAns.ycount=parseInt(zdsdY);myAns.yoffset=(parseFloat(czpy.text)+c)*v;if(scjx.selection==0||scjx.selection==2){myAns.tombo=true}else{myAns.tombo=false}regWin.close()};regWin.show()}if(ScriptUI.environment.keyboardState.shiftKey){vb=true}else{vb=false}function6();function function4(){regWin2=new Window("dialog","设置",[0,0,285,340],{resizeable:true,resizeable:false});banz=regWin2.add("panel",[10,25,275,145],"帮助");note3=banz.add("edittext",[10,10,250,100],"【极速拼版V1.0】\n\n【使用方法】\n将压缩包中的〖极速拼版V1.0.jsx〗脚本文件,复制到AI软件《Presets》(中文版是预设)—《zh-CN》—《脚本》文件夹中,重启AI软件,就可以在《文件》—《脚本》目录下找到〖极速拼版V1.0〗菜单。\nAI CS6 以上版本可以使用,可以添加到脚本文件夹中使用,可以添加到脚本管理器中使用,可以添加到合集中使用。\n【记忆功能】\n〖常用〗情况下修改数据点击〖确定〗退出脚本,再次进入脚本将是修改过的〖常用〗数据。推荐将常用数据保存到〖常用〗里面,这样每次进入脚本就会显示常用数据。〖确定〗和〖保存〗请按〖回车键〗,〖取消〗请按〖Esc键〗。\n〖1〗情况下修改数据点击〖确定〗退出脚本,再次进入脚本将是修改过的〖常用〗数据,不会显示〖1〗数据,只能点击〖控制面板〗〖1〗才能获取预存的数据。\n【修改文字】\n点击〖设置〗〖保存位置〗将〖1〗改为〖复制十组〗点击〖保存〗,然后点击控制面板〖1〗,这时控制面板〖预设〗按钮〖1〗就会变为〖复制十组〗。\n【预设保存】\n修改〖控制面板〗参数,进入〖设置〗修改〖设置面板〗参数,〖保存位置〗—〖常用〗—〖保存〗,这时〖控制面板〗〖常用〗就预存自己常用的数据。〖1〗至〖5〗预设参照〖常用〗设置类推。\n【恢复默认】\n打开〖我的文档〗或〖此电脑〗〖文档〗,找到〖极速拼版V1.0〗数据文件夹,将这个文件夹删除,预设数据全部丢失,恢复到最初默认数据。\n【自动拼版】\n读取〖水平自动〗和〖垂直自动〗数据,点击〖确定〗进行自动拼版。\n【手动拼版】\n读取〖水平数量〗和〖垂直数量〗数据,点击〖确定〗进行手动拼版。\n【水平自动】\n自动计算水平方向页面内复制数量,不包含裁切线。\n【垂直自动】\n自动计算垂直方向页面内复制数量,不包含裁切线。\n【出血模式】\n〖不含出血〗生成1根裁切线。\n〖全部出血〗生成2根裁切线。\n【裁切模式】\n〖裁切线〗选项,生成套版色裁切线。\n〖裁切线-无〗选项,不生成裁切线。\n〖裁切线-页面〗选项,裁切线适合页面边界。\n【裁切长度】\n设置裁切线长度,默认:5毫米。\n【裁切粗细】\n设置裁切线粗细,默认:0.1毫米。\n【裁切出血】\n两个物件之间生成裁切线,默认:3毫米。\n【裁切偏移】\n设置裁切线离开物件的数值,默认:3毫米。\n【极速拼版支持蒙版】\nCPC中文印刷社区 tiantian1998\n华印社区 tiantian\n2023年11月11日",{readonly:1,noecho:0,borderless:0,multiline:1,enterKeySignalsOnChange:0});yushe2=regWin2.add("panel",[10,175,275,280],"保存位置");weizhi0=yushe2.add("radiobutton",[10,15,30,35]);weizhi0.value=0;weizhi0.helpTip="保存数据至预设〖1〗";weizhi2=yushe2.add("radiobutton",[140,15,160,35]);weizhi2.value=0;weizhi2.helpTip="保存数据至预设〖2〗";weizhi3=yushe2.add("radiobutton",[10,40,30,60]);weizhi3.value=0;weizhi3.helpTip="保存数据至预设〖3〗";weizhi4=yushe2.add("radiobutton",[140,40,160,60]);weizhi4.value=0;weizhi4.helpTip="保存数据至预设〖4〗";weizhi5=yushe2.add("radiobutton",[10,65,30,85]);weizhi5.value=0;weizhi5.helpTip="保存数据至预设〖5〗";weizhi1=yushe2.add("radiobutton",[140,65,250,85]);weizhi1.value=1;weizhi1.helpTip="保存数据至预设〖常用〗";ys0Value=yushe2.add("edittext",[160,65,250,85],PresetXml.ys0Value,{readonly:0,noecho:0,borderless:0,multiline:0,enterKeySignalsOnChange:0});ys1Value=yushe2.add("edittext",[30,15,120,35],PresetXml.ys1Value,{readonly:0,noecho:0,borderless:0,multiline:0,enterKeySignalsOnChange:0});ys2Value=yushe2.add("edittext",[160,15,250,35],PresetXml.ys2Value,{readonly:0,noecho:0,borderless:0,multiline:0,enterKeySignalsOnChange:0});ys3Value=yushe2.add("edittext",[30,40,120,60],PresetXml.ys3Value,{readonly:0,noecho:0,borderless:0,multiline:0,enterKeySignalsOnChange:0});ys4Value=yushe2.add("edittext",[160,40,250,60],PresetXml.ys4Value,{readonly:0,noecho:0,borderless:0,multiline:0,enterKeySignalsOnChange:0});ys5Value=yushe2.add("edittext",[30,65,120,85],PresetXml.ys5Value,{readonly:0,noecho:0,borderless:0,multiline:0,enterKeySignalsOnChange:0});shezhiOK=regWin2.add("button",[103.33,298,181.66,322],"保存",{name:"ok"});shezhiOK.helpTip="保存请按回车键";shezhiquziao=regWin2.add("button",[186.66,298,265,322],"取消");shezhiquziao.helpTip="取消请按Esc键";shezhiOK.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()};shezhiquziao.onClick=function(){regWin2.close()}}function function6(){doc=app.activeDocument;var a="trim";try{var b=doc.layers[a];b.locked=false;b.visible=true}catch(err){var b=doc.layers.add();b.name=a}g1=b.groupItems.add();for(var i=0;i<doc.spots.length;i+=1){if(doc.spots.typename=="Spot"&&doc.spots.colorType==ColorModel.REGISTRATION){regColor=new SpotColor();regColor.spot=doc.spots;break}}if(app.documents.length==0){alert("请打开文件!");return}if(app.selection.length==0){alert("请选择物体!");return}var c=app.activeDocument.rulerUnits;if(c==RulerUnits.Centimeters){v=28.3466796875}else{if(c==RulerUnits.Millimeters){v=2.83466796875}}var d=getselectedbounds(app.activeDocument.selection);var e=app.activeDocument.width;var f=d[2]-d[0];var g=Math.floor(e/f);var h=app.activeDocument.height;var j=d[1]-d[3];var k=Math.floor(h/j);function1(f/v,g,j/v,k);if(myAns.cancel){return}makeTombo(app.selection,myAns.xoffset,myAns.xcount,myAns.yoffset,myAns.ycount,myAns.tombo,d);ai_dup_selected_box(app.selection,myAns.xoffset,myAns.xcount,myAns.yoffset,myAns.ycount);app.redraw()}function ai_dup_selected_box(a,b,c,d,e){for(var N=0;N<a.length;N+=1){var f=a[N].geometricBounds;var g=f[0];for(var X=0;X<c;X+=1){var h=f[1];for(var Y=0;Y<e;Y+=1){if(X==0&&Y==0){}else{var i=a[N].duplicate();var j=new Array(g,h);i.position=j}h=h-d}g=g+b}}}function getselectedbounds(a){var b=a.length;var c=new Array();var d=new Array();var e=new Array();var f=new Array();for(var k=0;k<b;k+=1){r=NO_CLIP_BOUNDS(a[k]);if(vb){r1=r[4];r2=r[5];r3=r[6];r4=r[7]}else{r1=r[0];r2=r[1];r3=r[2];r4=r[3]}c.push(r1);d.push(r2);e.push(r3);f.push(r4)}r1=MIN_IN_ARRAY(c);r2=MAX_IN_ARRAY(d);r3=MAX_IN_ARRAY(e);r4=MIN_IN_ARRAY(f);return Array(r1,r2,r3,r4)}function NO_CLIP_BOUNDS(c){var d=new Array();GET_NO_CLIP_OBJECTS_AND_MASKS(c);var e=new Array();var f=new Array();var g=new Array();var h=new Array();var j=new Array();var k=new Array();var l=new Array();var m=new Array();for(var i=0;i<d.length;i+=1){f=d.geometricBounds[0];e=d.visibleBounds[0];h=d.geometricBounds[1];g=d.visibleBounds[1];k=d.geometricBounds[2];j=d.visibleBounds[2];m=d.geometricBounds[3];l=d.visibleBounds[3]}var n=MIN_IN_ARRAY(e);var o=MIN_IN_ARRAY(f);var p=MAX_IN_ARRAY(g);var q=MAX_IN_ARRAY(h);var r=MAX_IN_ARRAY(j);var s=MAX_IN_ARRAY(k);var t=MIN_IN_ARRAY(l);var u=MIN_IN_ARRAY(m);return[o,q,s,u,n,p,r,t];function GET_NO_CLIP_OBJECTS_AND_MASKS(a){if(IS_CLIP(a)){d.push(a.pageItems[0]);return}if(a.constructor.name=="GroupItem"){try{var b=a.pageItems.length;for(var i=0;i<b;i+=1){GET_NO_CLIP_OBJECTS_AND_MASKS(a.pageItems)}}catch(error){}return}d.push(a);return}}function IS_CLIP(a){try{if(a.constructor.name=="GroupItem"){if(a.clipped){return true}}}catch(error){}return false}function MAX_IN_ARRAY(a){var b=a[0];for(var i=0;i<a.length;i+=1){if(a>b){b=a}}return b}function MIN_IN_ARRAY(a){var b=a[0];for(var i=0;i<a.length;i+=1){if(a<b){b=a}}return b}function makeTombo(a,b,c,d,e,f,g){if(!f){return}var h=activeDocument.groupItems.add();h.name="tombo";if(chuxms.selection==0){var i=g[0];var j=g[1];var k=g[2];var l=g[3]}else{var i=g[0]+cc;var j=g[1]-cc;var k=g[2]-cc;var l=g[3]+cc}var m=k-i;var n=l-j;var o=k+(b*(c-1));var p=l-(d*(e-1));var q=j+(cx+cd);var r=j+cx;var s=p-(cx+cd);var t=p-cx;for(var X=0;X<c;X+=1){var u=i+(b*X);drowLine(u,u,q,r,lw,h);drowLine(u,u,s,t,lw,h);if(m!=b){drowLine(u+m,u+m,q,r,lw,h);drowLine(u+m,u+m,s,t,lw,h)}}if(m==b){drowLine(o,o,q,r,lw,h);drowLine(o,o,s,t,lw,h)}var u=i-(cx+cd);var v=i-cx;var w=o+(cx+cd);var x=o+cx;for(var Y=0;Y<e;Y+=1){var q=j-(d*Y);drowLine(u,v,q,q,lw,h);drowLine(w,x,q,q,lw,h);if(n!=d){drowLine(u,v,q+n,q+n,lw,h);drowLine(w,x,q+n,q+n,lw,h)}}if(n==d){drowLine(u,v,p,p,lw,h);drowLine(w,x,p,p,lw,h)}if(scjx.selection==2){Ab=doc.artboards[doc.artboards.getActiveArtboardIndex()];Ab.artboardRect=h.geometricBounds}}function drowLine(a,b,c,d,e,f){myLine=f.pathItems.add();myLine.setEntirePath([[a,c],[b,d]]);myLine.filled=false;myLine.stroked=true;myLine.strokeWidth=e;myLine.strokeColor=regColor}function function3(a,b,c){var d=new File(b);d.lineFeed="Windows";if(a=="read"){d.open("r");var c=d.read();return c}if(a=="write"){d.open("w","TEXT","????");d.write(c);d.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)resetXml=new XML("<reset></Preset>")resetXml.ys0Value="常用"resetXml.ys1Value="1"resetXml.ys2Value="2"resetXml.ys3Value="3"resetXml.ys4Value="4";PresetXml.ys5Value="5";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.spcf=2;AutoMarkXml.czcf=2;AutoMarkXml.sppy=0;AutoMarkXml.czpy=0;AutoMarkXml.cqcd=5;AutoMarkXml.cqcx=0.1;AutoMarkXml.cqpy=3;AutoMarkXml.cqcc=3;AutoMarkXml.scjx=1;AutoMarkXml.zdong=0;AutoMarkXml.sdong=1;AutoMarkXml.chuxms=0;Contents=AutoMarkXml;function3("write",gArgG,Contents)}function function7(){AutoMarkXml.spcf=spcf.text;AutoMarkXml.czcf=czcf.text;AutoMarkXml.sppy=sppy.text;AutoMarkXml.czpy=czpy.text;AutoMarkXml.cqcd=cqcd.text;AutoMarkXml.cqcx=cqcx.text;AutoMarkXml.cqpy=cqpy.text;AutoMarkXml.cqcc=cqcc.text;AutoMarkXml.scjx=scjx.selection-0;AutoMarkXml.zdong=zdong.value-0;AutoMarkXml.sdong=sdong.value-0;AutoMarkXml.chuxms=chuxms.selection-0;Contents=AutoMarkXml;function3("write",gArgG,Contents)}function checkSetFolder(){var a=new Folder(set_folder);if(!a.exists){a.create()}} |
|