6 Replies Latest reply on Aug 13, 2013 10:29 PM by Vamitul

    incremental object transform over multiple pages?

    puddlesinla

      hi, i'm wondering if anybody knows of a script or an easy way to transform an object incrementally over a number of pages.

      in my case, i would like a header and folios to travel slowly across the top and sides of a book, page by page. the book is 212 pages long and i would like the effect to be almost like an oldfashioned flipbook, where if you thumbed the pages quickly you would watch the folio slide from top to bottom.

      the best i can come up with is to do this manually (copy, paste-in-place, move one increment, copy again, next spread, repeat) but this seems incredibly tedious, not to mention error-prone over the course of 106 spreads.

      thanks in advance for any help!

      ben

        • 1. Re: incremental object transform over multiple pages?
          Jump_Over Level 5

          Hi,

           

          Dont know of the script but know how to do it. Your ask for help is related to writing a script, hopefully.

           

          So pageItem method duplicate() has parameters to: and by: which could be used for your goal.

          I.e. pageItem.duplicate( Page, [x,y] ) will duplicate your object to Page and move it by x and y.

           

          So all the rest is to create a correct loop, to name objects, to calculate steps and increment.

           

          Jarek

          1 person found this helpful
          • 2. Re: incremental object transform over multiple pages?
            Vamitul Level 4

            very easy to make, but i don't have the time for now.

             

            it would work like this:

             

            on your master page create the "tavelling items", group them, and give them a meaningful name, using the layers palette (ex: "MyMovingGroup").

             

            the script itself is something like (not tested, not working, just a beginning):

             

            function main(){

            var doc=app.activeDocument; pages=doc.pages

            var increase=2; //value to move on each page, in mm

             

            for (var i=0; i<pages.length; i++){

            myTraveller=pages[i].masterPageItems.itemByName("MyMovingGroup").override(pages[i]); //i don't think it works, masterPageItems returns an array?

            myTraveller.move(undefined,[0,i*increase]);

             

            }main();

            1 person found this helpful
            • 3. Re: incremental object transform over multiple pages?
              puddlesinla Level 1

              vamitul,

               

              i can't quite get it to work. i have essentially no scripting experience, but i'm confident that once i get a running script, i will be able to tweak it to work with my parameters.

               

              i don't know how to correct for the masterPageItems array issue. i wonder if this is a relevant discussion: http://forums.adobe.com/message/4429703 ?

               

              when i run the script you suggested, i get "Error Number: 24

              Error String: pages[i].masterPageItems.itemByName is not a function"

               

              if you have time, i would be so grateful if you could help push this along.

               

              thank you!

               

              ben

              • 4. Re: incremental object transform over multiple pages?
                Vamitul Level 4

                ok.. i'm at home so i can't realy test this much, but, using jarek's method (faster, easiear, better etc):

                create the "travelling" items on the first page of your document.

                Select them ( if you have more items the script will group them, but make sure you have at least one page item selected because i didn't add too much error checking to the script), and run the script.

                 

                function main(){
                    var doc=app.activeDocument;
                    var sel=doc.selection;
                    var myTaveller=sel.length>1?doc.groups.add(sel):sel[0];
                    var myDist=prompt ("Distance to move on each page in current vertical measurements", 1, "Distance");
                    var pages=doc.pages.everyItem().getElements();
                      
                    for (var i=0; i<pages.length; i++)    {
                        myTaveller.duplicate(pages[i],[0,myDist*i]);
                        }
                    
                    
                    }app.doScript("main()",undefined,undefined,UndoModes.entireScript,"Traveller Group");
                
                

                 

                now.. if you need it to work for even/odd pages, it needs some modifications (just add another prompt to ask if the user wants to go from two to two pages, if so, double the myDist, and change the loop to go form two to two), but it's quite late for me now, i'w benn working for 13 hours now, so, if i have the time, mabye tommorow i can modify it if you or someone else won't, and you need it.

                 

                Best of luck,

                Vlad.

                • 5. Re: incremental object transform over multiple pages?
                  puddlesinla Level 1

                  vlad and jarek

                   

                  AWESOME!!!

                   

                  you guys are the best and i can't thank you enough for taking the time to help me out.

                   

                  hopefully you're asleep already vlad. my scripting skills are almost nil so i don't know how to write in the variation for even/odd pages and i'd be curious to see how that's done, but there is NO RUSH, and in fact, if you're bored of this already don't even worry about it. i can just go in and delete the objects it created from the pages i don't want them on. no big deal.

                   

                  thanks again for taking the time, especially after a 13 hour work day!

                   

                  best, ben

                  • 6. Re: incremental object transform over multiple pages?
                    Vamitul Level 4

                    I'we started working on a bit more advanced version, based on my original master page item idea, as it is more flexible (based on your master, you could, for example, have pages without travellers, or different colored/shaped ones for chapters etc). It should be ready in a few days, but right now i'm swamped with other work.