Copy link to clipboard
Copied
I am trying to find a simple script on how to rotate a selection using javascript within InDesign CS3. Any ideas!?
Thanks in Advance!
Hey!
var myObj = app.selection[0];
myObj.rotationAngle = 45;
or, if you want just to rotate selection, and you dont need variable for next operation
app.selection[0].rotationAngle = 45;
tomaxxi
Copy link to clipboard
Copied
Hey!
var myObj = app.selection[0];
myObj.rotationAngle = 45;
or, if you want just to rotate selection, and you dont need variable for next operation
app.selection[0].rotationAngle = 45;
tomaxxi
Copy link to clipboard
Copied
Thanks again tomaxxi! That was my last major hurdle as a newby. It's amazing how the simple ones seem so hard to find. Thanks again!!!
Copy link to clipboard
Copied
Is there a way to set the reference point to middle? I noticed that it will
rotate based on the current selection of reference point.
Copy link to clipboard
Copied
Hey!
Yeah, you can!
app.activeWindow.transformReferencePoint = AnchorPoint.CENTER_ANCHOR
or you can check my InDesign Scripting Snippets blog
http://indisnip.wordpress.com/2010/07/24/rotate-single-selected-object/
where I explained how it works.
tomaxxi
Copy link to clipboard
Copied
wow, that was fast! before I could even post my message you had already responded. 🙂
Thanks again! Been having fun - especially putting them all together and making one major script that works exactly as it should. Now I have to put it to the ultimate test in reality. 🙂
Copy link to clipboard
Copied
I found this:
app.layoutWindows[0].transformReferencePoint = AnchorPoint.CENTER_ANCHOR;
it seems to work!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more