5 Replies Latest reply on Apr 17, 2013 8:43 AM by shilpa25

    Place assets only on First page

    shilpa25 Level 1

      Hi Forum,

       

      I m wondering, if can i place my Library assets.item(0) only on first page.

       

      Because the below script places the Library assets, when i click a particular page...

       

      Instead, when i run the script, the assets should be placed only on the first page..

       

      Is it possible... I tried this way.. but doesnt works...

       

      pg = app.activeDocument.pages.item(0);

      //myrect = pg.rectangles.add(); (i tested with adding rectangles on the first page, it works)

      var Lib = app.libraries[0].assets[0].placeAsset[pg][0];

       

      thanks for the help forum...

      Shil..

        • 1. Re: Place assets only on First page
          -hans- Level 4

          onDocument

          Text

           

          Those are the possibilties.

           

          So only a trick would work:

          Create a empty textframe on destpage and place the asset on its insertionpoints[0].

          Then set anchored objectsettings to customized (x,y to textframe top/ left zero).

          detach the anchored object. Delete the textframe.

           

          otherwise conventionell:

          move the object after placing on document to any page.

          1 person found this helpful
          • 2. Re: Place assets only on First page
            shilpa25 Level 1

            hi -hans- thanks very much for your quick response.....


            will moving the object placed to any page is possible. because i have a little bit confusing on selecting the placed object (if is the grouped text) alongwith the other text boxes on the same page.

             

            how can i refer the placed object in script.

             

            sorry for the confused state of question....


            thanks for the reply.

             

            shil....

            • 3. Re: Place assets only on First page
              shilpa25 Level 1

              hi -hans-

               

              thanks for you brilliant idea...

               

              now, i have tried like this...

               

               

              pg = app.activeDocument.pages.item(0);

              var myObj = app.libraries[0].assets[0].placeAsset(app.documents[0])[0];

              app.select(myObj);

              app.selection[0].move (app.activeDocument.pages[0]);

               

              ( it would be appreciate, if i get idea for delesecting the previous selected items and then select the corrently placed one).

               

              thanks - hans-

              • 4. Re: Place assets only on First page
                -hans- Level 4

                no need to select as you've already stored the obj in myObj

                 

                var currDoc = app.activeDocument;

                var myObj = app.libraries[0].assets[0].placeAsset(currDoc)[0];

                myObj.move(currDoc.pages[0]);

                • 5. Re: Place assets only on First page
                  shilpa25 Level 1

                  thank you -hans-,

                   

                  you have simplified my complex script.

                  1 person found this helpful