论坛帮助 |
社区圈子 |
日历事件 |
2018-01-16, 09:07 | #1 | ||
|
|||
正式会员
等级: 三袋长老
|
var artboardRef = myDoc.artboards sel=myDoc.selection; var abBounds = myDoc.artboards[0].artboardRect; myDoc.artboards[0].artboardRect = [sel[0].left ,sel[0].top, sel[0].geometricBounds[2], sel[0].geometricBounds[3]]; 哪位大佬能帮改下,支持剪切蒙版的 |
||
2018-01-16, 12:45 | 只看该作者 #2 | |||
|
||||
正式会员
等级: 四袋长老
|
//转为画框 var doc = app.activeDocument; var obj = doc.selection; var bnd = new Array(); if (documents.length > 0) { if (obj.length > 0) { bnd = getBounds(obj); W = bnd[2] - bnd[0]; H = bnd[1] - bnd[3]; X = bnd[0]; Y = bnd[1]; } else { doc.rulerOrigin = Array(0, 0); bnd[0] = 0; bnd[2] = doc.width; bnd[1] = doc.height; bnd[3] = 0; } doc.cropBox = bnd; doc.cropStyle = CropOptions.Standard; } function getBounds(obj) { var selObj1 = new Array(); var selObj2 = new Array(); var vgb1 = new Array(); var vgb2 = new Array(); var n = obj.length; if (n > 0) { if (obj[0].typename == "GroupItem" && obj[0].clipped && obj[0].pageItems.length > 1) { clipObj = obj[0].pathItems[0].geometricBounds; vgb1 = clipObj; } else { selObj1 = obj[0]; vgb1 = selObj1.visibleBounds; } if (n > 1) { for (var i = 1; i < n; i += 1) { selObj2 = obj[i]; if (obj[i].typename == "GroupItem" && obj[i].clipped && obj[i].pageItems.length > 1) { vgb2 = obj[i].pathItems[0].geometricBounds; } else { vgb2 = selObj2.visibleBounds; } if (vgb1[0] > vgb2[0]) { vgb1[0] = vgb2[0] } if (vgb1[1] < vgb2[1]) { vgb1[1] = vgb2[1] } if (vgb1[2] < vgb2[2]) { vgb1[2] = vgb2[2] } if (vgb1[3] > vgb2[3]) { vgb1[3] = vgb2[3] } } } } return vgb1; } |
|||
2018-03-23, 16:06 | 只看该作者 #4 | |||
|
||||
购买金币请联系微信
等级: 八袋长老
|
__________________
Illustrator Quicker工具箱,分层分画板导出JPG或PDF,标注尺寸,多重复制,更新链接,更新页码,嵌入图片替换链接等等 接受 Quicker 动作及简单AI脚本定制 QQ:842504060 微信:neteasy2014 |
|||