7 Replies Latest reply on Jan 23, 2009 1:58 PM by sstanleyau

    How Do I Rotate Content, Not the Frame

      I am in InDesign CS1.

      I need to figure out how to affect the content of a placed image, not the surrounding frame. I know how to set the rotation angle of the selected object's frame:

      set rotation angle of selection to 10

      But for the life of me, I cannot understand how to leave the frame as it is and just rotate the content. I.E., normally, if I grab the direct selection tool and click an image (hovering over the image inside the frame turns to the hand tool), I can then manipulate the content without affecting the outside frame. But I want to do this with an AppleScript.

      I also assume that if someone can open this door for me, it will then lead the way to being able to scale the content, without affecting the frame. But I cannot figure out the secret of "content" vs. "selection". Halp!

      Thank you!
        • 1. Re: How Do I Rotate Content, Not the Frame
          Kasyan Servetsky Level 5
          Hi Achy,

          I'm on CS3, but hope it will work on CS1.

          tell application "Adobe InDesign CS3"
          set myDoc to active document
          set myFrame to rectangle 1 of myDoc
          set myImage to image 1 of myFrame
          set absolute rotation angle of myImage to 10
          end tell

          Kasyan
          • 2. Re: How Do I Rotate Content, Not the Frame
            Kasyan Servetsky Level 5
            P.S. So, your line should be:
            set rotation angle of image 1 of selection to 10
            • 3. Re: How Do I Rotate Content, Not the Frame
              Level 1
              I am trying your suggestion, but I the script hangs at the term "image 1" (or even just "image").

              Not sure where to go from there.

              What really confuses me is that I thought that "set rotation angle" should adjust the frame while "set absolute rotation angle" would adjust only the content, not the frame. But they both give me the same result of rotating the frame. Argybargy!
              • 4. Re: How Do I Rotate Content, Not the Frame
                Kasyan Servetsky Level 5
                I don't have neither ID CS1 nor its reference, so I can't check if the syntax is correct.
                There is a difference between absolute rotation angle and rotation angle:

                absolute rotation angle The rotation angle applied to the object, not including any rotation applied to its containing object.

                rotation angle The rotation angle applied to the object, including any rotation applied to its containing object.

                I prefer to use absolute rotation angle.
                • 5. Re: How Do I Rotate Content, Not the Frame
                  Level 1
                  Your definitions are what I would expect, but for me, applying each version as one of these two separate scripts:

                  1)
                  tell application "InDesign CS"
                  activate
                  set rotation angle of selection to 10
                  end tell

                  2)
                  tell application "InDesign CS"
                  activate
                  set absolute rotation angle of selection to 10
                  end tell

                  Gives me the same result. The frame rotates and the content rotates with it.

                  Let me start over with my problem as that may help...

                  So let's say I have a frame and it has rotation 0˚. Inside the frame I have an object rotated to 5˚.

                  Applying either of those two scripts has the same result. The frame rotates to 10˚ and the content (when selected with the direct selection tool) now shows a rotation of 15˚.

                  But what I want is for the frame to stay at 0˚ and the content (when selected with the direct selection tool) to show a rotation of 15˚.

                  I am thinking this may be relates to the "Transform Content" and "Transformations Are Totals" preference settings. Both of which I have turned on. I know how to turn them on and off with an AppleScript, but it doesn't seem to be helping.
                  • 6. Re: How Do I Rotate Content, Not the Frame
                    Kasyan Servetsky Level 5
                    You get the same results because you're rotating container, not contents. You should rotate the image inside the rectangle, not the rectangle.
                    • 7. Re: How Do I Rotate Content, Not the Frame
                      sstanleyau Level 4
                      On 24/1/09 4:19 AM, "Achy Fakey" <member@adobeforums.com> wrote:<br /><br />> I am trying your suggestion, but I the script hangs at the term "image 1" (or<br />> even just "image").<br /><br />Use "graphic" instead of image -- image means bitmap picture, whereas<br />graphic refers to any sort.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>