DTP駆け込み寺

No.12643へ返信

記事投稿フォーム
補助
送信

[ 返信 ]

Re: InDesign CS5.5 ショトカトで1°回転

謝りつつ 少し直しました
任意の基準点を軸に1°回転します。

function unitFunc(ary){
app.activeWindow.transformReferencePoint=["1pt", 0];
x= app.activeWindow.transformReferencePoint[0];
app.activeWindow.transformReferencePoint=ary;
return x;
}

var myruler = false;
if (app.activeDocument.viewPreferences.rulerOrigin != 1380143983) {
myruler = app.activeDocument.viewPreferences.rulerOrigin;
app.activeDocument.viewPreferences.rulerOrigin = 1380143983;
}

if(app.activeDocument.selection.length){
aa=app.activeDocument.selection[0];
tt=app.transformationMatrices.add(1,1,0,1,0,0);
bb=aa.rotationAngle;
cc=app.activeWindow.transformReferencePoint;
if(cc.reflect.name=="Array"){
unitObj=unitFunc(cc);
dd=[[cc[0]*unitObj, cc[1]*unitObj],[0,0]];
} else{
dd=cc;
}
aa.transform (2021222766, dd, tt, undefined, undefined);
}

if (myruler) {
app.activeDocument.viewPreferences.rulerOrigin = myruler;
}

[12643] (z-) (2011/08/26 Fri 19:05)