1 Reply Latest reply on May 5, 2015 5:31 AM by frameexpert

    How do I update the tabstop information on a pgf

    tracey.orso Level 1

      I have>        

       

          var  doc=app.ActiveDoc;    

                      SelectElement (doc, para);      

                       var textRange = new TextRange;

                      textRange.beg.obj = textRange.end.obj = para;

                      textRange.beg.offset = 1;

                      textRange.end.offset = Constants.FV_OBJ_END_OFFSET;

                      doc.TextSelection = textRange;

                      textRange = doc.TextSelection;

                      var pgf = doc.TextSelection.beg.obj;

       

       

      and now I need to set the tab stop New Position to a variable value, the alignment to left and the leader to .

       

       

      any help appreciated, thanks!

       

      Tracey

        • 1. Re: How do I update the tabstop information on a pgf
          frameexpert Level 4

          Hi Tracey, Here is some code that should get you moving in the right direction. Please let me know if you have any questions or comments. Thanks. -Rick

           

          #target framemaker
          
          // Make a constant for the points metric value.  
          var PT = 65536;  
          
          // Set a variable for the active document.
          var doc = app.ActiveDoc;
          // Set a variable for the paragraph containing the insertion point.
          var pgf = doc.TextSelection.beg.obj;
          
          // Set the paragraph's current Tabs to a variable.
          var tabs = pgf.Tabs;
          
          // Make a Tab object and set its properties.
          var tab = new Tab ();
          tab.x = 288 * PT; // 4 inches
          tab.type = Constants.FV_TAB_LEFT; // Align left
          tab.leader = "."; // Leader set to dot.
          
          // Push the new tab to the end of the Tabs variable.
          tabs.push (tab);
          
          // Apply the updated Tabs variable to the paragraph.
          pgf.Tabs = tabs;