Skip to main content
rombanks
Inspiring
November 13, 2014
解決済み

ES for FM10: Adding text at insertion point

  • November 13, 2014
  • 返信数 22.
  • 3345 ビュー

Hello fellows,

What's the code for current insertion point (where the cursor is currently placed?)

I saw code for adding text in the beginning/end of pgf but not at the current insertion point.

Thank you in advance!

このトピックへの返信は締め切られました。
解決に役立った回答 frameexpert

Try using textLoc instead of TextLoc for your variable. TextLoc with this spelling is a reserved word.

返信数 22

frameexpert
Community Expert
Community Expert
November 13, 2014

Assuming doc is the active document, this will give you the current text selection:

var textRange = doc.TextSelection;

To get the insertion point, use either:

var textLoc = doc.TextSelection.beg;

or

var textLoc = doc.TextSelection.end;

-Rick

www.frameexpert.com
rombanks
rombanks作成者
Inspiring
November 13, 2014

Hi Rick,

Thank you for your response and suggestion!

The following code does not do anything while the cursor is in a paragraph,. Am I missing something?

var doc = app.ActiveDoc;

var Tsel = doc.TextSelection;

var TextLoc = Tsel.beg;

doc.AddText (TextLoc, "Test ");

Thank you!

frameexpert
Community Expert
frameexpertCommunity Expert解決!
Community Expert
November 13, 2014

Try using textLoc instead of TextLoc for your variable. TextLoc with this spelling is a reserved word.

www.frameexpert.com