Skip to main content
Known Participant
May 5, 2015
Question

How do I update the tabstop information on a pgf

  • May 5, 2015
  • 1 reply
  • 327 views

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

This topic has been closed for replies.

1 reply

frameexpert
Community Expert
Community Expert
May 5, 2015

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;

www.frameexpert.com