var sel0=app.selection[0];
switch (sel0.constructor.name){
case "TextFrame":
case "RasterItem":
var m=invertMatrix(sel0.matrix)
m.mValueTX=m.mValueTY=0;
sel0.transform(m);
app.executeMenuCommand('AI Reset Bounding Box');
break;
case "PlacedItem":
var m=invertMatrix(sel0.matrix)
m.mValueTX=m.mValueTY=0;
if (sel0.file.fsName.substr(-3).match(/eps/i)){
m.mValueB*=-1;
m.mValueC*=-1;
} else {
m.mValueC*=-1;
m.mValueD*=-1;
}
sel0.transform(m);
app.executeMenuCommand('AI Reset Bounding Box');
break;
case "PathItem":
case "CompoundPathItem":
var c=app.activeDocument.defaultFillColor ;
if (c.constructor.name!="PatternColor") break;
var m=invertMatrix(c.matrix);
m.mValueB*=-1;
m.mValueC*=-1;
sel0.transform(m,0,1,0,0,0);
break;
}
プロフィール
最近の記事