Illustratorで作成したトンボを自動で選択して裁ち落としサイズを調べるするスクリプト

スポンサーリンク
 
  • 1157月別訪問者数:

とりあえずこちらもソースだけ。。
前々回のスクリプトと前回のスクリプトをただ合体させただけなり

activeDocument.selection = null;
 var PathObj = activeDocument.pathItems;
 for (var i=0,Len = PathObj.length; i < Len; i++){
 var TPath = PathObj[i];
 if(TPath.strokeColor.spot=="[Spot [レジストレーション]]" & Math.round(TPath.strokeWidth*1000) ==300){
 TPath.selected=true;
 }
 }
 var SelObj=activeDocument.selection;
 var MinX=SelObj[0].visibleBounds[0]
 var MaxX=SelObj[0].visibleBounds[2]
 var MinY=SelObj[0].visibleBounds[1]*-1
 var MaxY=SelObj[0].visibleBounds[3]*-1
 for (var i=1,Len = SelObj.length; i < Len; i++){ var SelB = SelObj[i].visibleBounds; if(MinX>SelB[0])MinX=SelB[0];
 if(MaxX<SelB[2])MaxX=SelB[2]; if(MinY>SelB[1]*-1)MinY=SelB[1]*-1;
 if(MaxY<SelB[3]*-1)MaxY=SelB[3]*-1;
 }
X=Math.round((MaxX-MinX-72)*(25.4 /72)*1000)/1000
 Y=Math.round((MaxY-MinY-72)*(25.4 /72)*1000)/1000
 alert ("裁ち落としサイズ:W"+X+"mm×H"+Y+"mm ")

コメント