【发布时间】:2012-07-22 20:16:10
【问题描述】:
加油!我搜索了高低,但不知道如何使用 Extendscript (jsx) 水平翻转单个选定对象。
有人可以帮忙吗?这当然不难!
【问题讨论】:
标签: javascript transform adobe-illustrator extendscript
加油!我搜索了高低,但不知道如何使用 Extendscript (jsx) 水平翻转单个选定对象。
有人可以帮忙吗?这当然不难!
【问题讨论】:
标签: javascript transform adobe-illustrator extendscript
试试这样的:
mySelection = activeDocument.selection;
if (mySelection.length>0){
var doc = app.activeDocument; //current document
var s = doc.selection; //current slection
var sl = s.length; //number of selected objects
var m = app.getScaleMatrix(-100,100); //H flip matrix - feel free to change to (100,-100) for vertical flip, etc.
for(var i = 0 ; i < sl; i++) s[i].transform(m); //for each selected element apply the flip matrix
app.redraw();
}else{
alert("Nothing selected!")
}
或者,您可以通过 Reflect X 对您的选择使用变换效果(通过效果 > 扭曲和变换 > 变换...) selected,这将单独翻转选择中的每个对象:
【讨论】:
app.redraw(); 我在整个内容中添加了一点包装;介意我用最终的工作脚本编辑你的帖子吗?
好吧,我仍然不知道如何翻转选定的对象,但是这里有一个页面,其中包含一个脚本来翻转页面上的每个对象。这很接近;但是,它不值得抽雪茄。
http://js4ai.blogspot.de/2010/11/flip-on-x-axis.html
好的,Profenza 先生有答案!
【讨论】:
我用 applescript 做这个,“fastscripts”我把它绑定到 command + shift + H (& V)
tell application "Adobe Illustrator"
if (count page items in document 1) > 0 then
set selectedItems to selection
set scaleMatrix to get scale matrix horizontal scale -100.0 vertical scale 100.0
transform every item in selectedItems using scaleMatrix
end if
end tell
【讨论】: