Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do you rotate a selection using Javascript?

Guest
Jul 23, 2010 Jul 23, 2010

I am trying to find a simple script on how to rotate a selection using javascript within InDesign CS3. Any ideas!?

Thanks in Advance!

TOPICS
Scripting
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advisor , Jul 23, 2010 Jul 23, 2010

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

Translate
Advisor ,
Jul 23, 2010 Jul 23, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 23, 2010 Jul 23, 2010

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!!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 24, 2010 Jul 24, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 24, 2010 Jul 24, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 24, 2010 Jul 24, 2010
LATEST

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. 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 24, 2010 Jul 24, 2010

I found this:

app.layoutWindows[0].transformReferencePoint = AnchorPoint.CENTER_ANCHOR;

it seems to work!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines