4 Replies Latest reply on Dec 2, 2013 3:49 AM by Green4ever

    Move objects to new page and rotate

    David_N_2000

      Hi

      I could do with some help with a script. The final piece of artwork will be a circular dial with information and figures placed around the edge.

       

      Basically I have a square (100x100mm) document that has been produced from a data merge, so I have 22 pages. Each page has 2 text boxes that are grouped and centred horizontally and vertically.

       

      I want to incrementally rotate each group (from the centre) on each page by 16.36 degrees. So the group on page 1 doesn’t rotate, page 2 will rotate 16.36, page 3 will rotate 36.72, page 4 will rotate 49.08 etc. – (The 16.36 degrees rotation is 360 degrees divided by the 22 pages, to make up the information that will be around the edge of the ‘dial’ artwork)

       

      Next I need each group on each page to move to page 1. This will leave me with all the groups on page 1, neatly rotated around the circular dial. As a bonus the script could also delete pages 2 to 22.

       

      I hope someone can help with this, I’m sure it’s easily do-able.

       

      Thanks in advance

      David

        • 1. Re: Move objects to new page and rotate
          Green4ever Level 3

          Hi David,

           

          Everyone in this forum are ready to help you. But you should start doing something for that. You cannot expect the entire work from others. After reading your post I am really interested to help you, but I cannot start from scratch. If you could start as mentioned below I will help you as it looks very simple for me.

           

          1. Create a single object group (2 text boxes).

          2. Duplicate and rotate it x degrees. Do this for n times.

           

          Thanks

          Green4ever

          • 2. Re: Move objects to new page and rotate
            Green4ever Level 3

            Hey David,

             

            Try the below script and let me know is this what you are expecting?

             

             

            var textFrameGroup = app.selection[0];//Should be valid selection
            var myitemCount = 22;
            var myDeg = 360;
            var roationAngle;
            for (var ic=0; ic<myitemCount; ic++){
                roationAngle = (myDeg/myitemCount) * (ic+1);
                var newFrame = textFrameGroup.duplicate(undefined, [0,0]);
                newFrame.rotationAngle = roationAngle;
            }
            

             

            ~Green4ever

            • 3. Re: Move objects to new page and rotate
              David_N_2000 Level 1

              Hi

               

              Thanks for your response. Yeah I understand that I can't expect others on the forum to do all the work, and really do appreciate all help I get. I'm fairly new to scripting, and i'm finding it difficult creating scripts from scratch. Once I see a simple script I can basically follow whats going on and can tweak it from that point. It's just getting going that I'm struggling with.

               

              Thanks for the script you've done above. It looks like it will do an aspect of what I'm after. I'm away for a couple of days but I will give it a try when I'm back home, and hopefully build on it from here. I will let you know how I get on.

               

              Thanks

              • 4. Re: Move objects to new page and rotate
                Green4ever Level 3

                Is it worked for you?