1 Reply Latest reply on Aug 12, 2008 3:32 AM by (Dave_Saunders)

    Inline Object Basealign

    hm_arul
      Hi scripters

      I am doing find and replace here, it works well.

      var myPath=prompt ('Enter your equation file path')

      app.findPreferences = NothingEnum.nothing;
      app.changePreferences = NothingEnum.nothing;
      app.findPreferences.appliedCharacterStyle = "EqnCallout";

      var myResults = app.activeDocument.search();

      for (i = myResults.length-1; i >= 0; i--)
      {
      var myimgname= myResults[i].contents.split('\r')[0];
      myPicFile = File(myPath + "/" + myimgname);
      if (myPicFile.exists)
      {
      myResults[i].place(myPicFile);
      }
      }

      Now my problem is when I am placing inline images it's not fitting in the correct baseline alignment. Images are overlaping with above and below lines. (I am fixing manually)

      How I can set inline images(object) set in the baseline?

      thanks in advance

      regards
      a r u l
        • 1. Re: Inline Object Basealign
          Level 1
          You need to assign auto-leading to the images, which can be done by your script as you place them. I usually use a character style for this kind of thing. Given that you have a reference to the text you're replacing, it could be as simple as adding:

          myResults[i].characters[0].appliedCharacterStyle = "myAutoStyle";

          immediately after the place command.

          Assuming of course, that you have a character style set up with the right name.

          Dave