论坛帮助 |
社区圈子 |
日历事件 |
2024-11-16, 16:40 | #1 | ||
|
|||
正式会员
等级: 一袋长老
|
alert("未选择对象!"); } else{ app.executeMenuCommand("copy"); var newDoc = app.documents.add(); newDoc.activate(); app.executeMenuCommand("paste"); var artboard = newDoc.artboards[0]; artboard.artboardRect = newDoc.visibleBounds; } var SELECTION=activeDocument.selection //var LeftX=TopY=RightX=BottomY=undefined; if(SELECTION.length>0){ var VIEW=app.activeDocument.activeView; var zoom=VIEW.zoom //centerPoint=app.activeDocument.activeView.centerPoint VIEW.zoom=1; var bounds=VIEW.bounds; var ViewW=bounds[2]-bounds[0]; var ViewH=bounds[1]-bounds[3]; VIEW.zoom=zoom; if(LeftX){LeftX=undefined;}; if(TopY){TopY=undefined;}; if(RightX){RightX=undefined;}; if(BottomY){BottomY=undefined;}; for(var num=0;num<SELECTION.length;num++){ var SELECTED=SELECTION[num].geometricBounds; var LeftX=(LeftX==undefined)?SELECTED[0]:((LeftX<SELECTED[0])?LeftX:SELECTED[0]); var TopY=(TopY==undefined)?SELECTED[1]:((TopY>SELECTED[1])?TopY:SELECTED[1]); var RightX=(RightX==undefined)?SELECTED[2]:((RightX>SELECTED[2])?RightX:SELECTED[2]); var BottomY=(BottomY==undefined)?SELECTED[3]:((BottomY<SELECTED[3])?BottomY:SELECTED[3]); }; var WidthX=RightX-LeftX; var HeightY=TopY-BottomY; var CenterX=(RightX+LeftX)/2; var CenterY=(TopY+BottomY)/2; var Zoom=(ViewW/ViewH<WidthX/HeightY)?ViewW/WidthX:ViewH/HeightY; VIEW.zoom=Zoom*0.9; VIEW.centerPoint=[CenterX,CenterY]; }; //$.writeln (SELECTION.length) |
||
回复时引用此帖 |
2024-11-16, 19:06 | #2 | ||
|
|||
正式会员
等级: 一袋长老
|
引用:
提取出来常规单位还是PT,主要的就是改常规单位为MM |
||
回复时引用此帖 |
2024-11-17, 14:13 | #3 | ||
|
|||
正式会员
等级: 一袋长老
|
引用:
直接替换那段也不行,命令错误,可能是我不会操作 |
||
回复时引用此帖 |