10 Replies Latest reply: Jun 4, 2012 5:07 AM by Sathya Rani M RSS

    Text frame is not moving

    Sathya Rani M

      Hi All,

       

      I am new to indesign javascript and trying to move the text frame in top of the page by using the below move command.

       

      myGraphics[j].parent.move[myY1,myX1];

       

      But unfortunately the frame is remaining in the same position and this is i need to achieve in Image placing of float tool.

       

      I am trying to move the text frame in the top of the page since need to place the images in top and bottom of the page.

       

      This is bottleneck case and last 3days struggling lot to get this scenario.

       

      Any help is greatly appreciated.

       

      Thank you in advance.

       

      Regards,

      Sathya Rani M

        • 1. Re: Text frame is not moving
          Green4ever Community Member

          I think you are speaking about the same case discuused in the below forum link,   is that you want. Looks like you both are working on the same task.

          http://forums.adobe.com/message/4450216#4450216

           

          ---------

          Green4ever

          • 2. Re: Text frame is not moving
            Techi Panda Community Member

            Hi try this

             

            myGraphics[j].parent.move([myY1,myX1]);

            • 3. Re: Text frame is not moving
              Sathya Rani M Community Member

              Hi,

               

              I have tried as per posted link also. But not getting the expected result.

               

              Could you please help me out in this.

               

              Regards,

              Sathya Rani M

              • 4. Re: Text frame is not moving
                Sathya Rani M Community Member

                Hi,

                 

                Thank you for your reply, the posted command also not working.

                 

                Could you please tel me how to place the images in the top and bottom of the page instead.? or how to locate the top of the page?

                 

                Expecting for your reply.

                 

                Regards,

                Sathya Rani M

                • 5. Re: Text frame is not moving
                  Green4ever Community Member

                  Hi if you need help at least you need to post your sample code. And tell us  where you are get stuck. Without that it is hard to help you.

                   

                  Green4ever

                  • 6. Re: Text frame is not moving
                    [Jongware] MVP

                    How is this different from your previous question in http://forums.adobe.com/message/4450216#4450216?

                     

                    The code in there works. If it does not for you, YOU HAVE TO TELL US WHY NOT.

                     

                    (Edit) "Bcs it doesnt do exactly what i want" is not a good answer.

                    • 7. Re: Text frame is not moving
                      Sathya Rani M Community Member

                      Hi Green4Ever/Jong,

                       

                      Thank you for writing to me and the question is same what ever posted in the mentioned link is same and more over i didnt say that is different from my case. I too tried with the same logic which is stated below.

                       

                                 for(i=0;i<myPages.length;i++)

                                  {

                                      var myGraphics=myPages[i].allGraphics;

                                      for(j=0;j<myGraphics.length;j++)

                                      {

                                          if(myPages[i].side == PageSideOptions.leftHand)

                                          {

                                              var myX2 = myPages[i].marginPreferences.left;

                                              var myX1 = myPages[i].marginPreferences.right;

                                          }

                                          else

                                          {

                                              var myX1 = myPages[i].marginPreferences.left;

                                              var myX2 = myPages[i].marginPreferences.right;

                                          }

                                        

                                          var myY1 = myPages[i].marginPreferences.top;

                                          var myX2 = myPageWidth - myX2;

                                          var myImageheight=myGraphics[j].parent.geometricBounds[2]-myGraphics[j].parent.geometricBound s[0];

                                          var myY2=myY1+myImageheight;

                                          myGraphics[j].parent.geometricBounds=[myY1,myX1,myY2,myX2];

                                          myGraphics[j].parent.move[myY1,myX1];

                                          myGraphics[j].parent.fit(FitOptions.proportionally);

                                          myGraphics[j].parent.fit(FitOptions.centerContent);

                                          // For text-wrap mode  - Working

                                          //myGraphics[j].textWrapPreferences.textWrapMode = TextWrapModes.CONTOUR;

                                          //myGraphics[j].textWrapPreferences.textWrapOffset = [24,12,24,12];

                                      }

                       

                      The frame is persisting in the center and not moving, i need to move the frame at the top.

                       

                      Kindly excuse me if i may post in different threads with the same scenario and if i posted any unwanted.

                       

                      Regards,

                      Sathya Rani M

                      • 8. Re: Text frame is not moving
                        Green4ever Community Member

                        Jongware's script is working good for me,

                         

                        for (p=0; pp=app.activeDocument.pages[p],p<app.activeDocument.pages.length; p++){
                        if (pp.allGraphics.length == 1){
                          pp.allGraphics[0].parent.move([pp.allGraphics[0].parent.geometricBounds[1], pp.marginPreferences.top]);
                          }
                        }
                        

                         

                        If it is not now working for you, you need to tell more about that. I mean in which case it is not working.

                         

                        Green4ever

                        • 9. Re: Text frame is not moving
                          [Jongware] MVP

                          Do NOT say "it is not working". DO say "I get the error "xxxx"", or "The script moves the object off the page", or "The script makes my computer crash". ANYTHING MORE than "it is not working". ANYTHING more.

                           

                          If you DID tell us the exact error message you got, it could have been something like

                           

                          JavaScript error on line 22: Syntax error

                          Line:

                          myGraphics[j].parent.move[myY1,myX1];

                           

                          ... but since you did NOT tell us what went wrong, we have to read your script top to bottom for obvious errors, set up a test document that might or might not be exactly your document, copy the script into a new file, run the script and then see for ourself why "it is not working".

                          • 10. Re: Text frame is not moving
                            Sathya Rani M Community Member

                            Hi All,

                             

                            I got the solution through this link.

                             

                            http://forums.adobe.com/message/4463129#4463129

                             

                            Thank you for your support.

                             

                            Regards,

                            Sathya Rani M