Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

What is insertion point and how it works

Explorer ,
Jan 08, 2019 Jan 08, 2019

What is insertion point and how it works? I didn't find a good explanation.

TOPICS
Scripting
8.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 08, 2019 Jan 08, 2019

In simple terms insertion point would be the cursor location in a textframe, i.e the space between two characters where the cursor blinks. If you want to insert something into the current cursor location, you could use something like

app.selection[0].contents = "inserted text"

-Manan

Translate
Community Expert ,
Jan 08, 2019 Jan 08, 2019

In simple terms insertion point would be the cursor location in a textframe, i.e the space between two characters where the cursor blinks. If you want to insert something into the current cursor location, you could use something like

app.selection[0].contents = "inserted text"

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 08, 2019 Jan 08, 2019

So when I use textFrame.insertionPoints[-1] for example, I have the coordinates where the last character of text within TextFrame is?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 08, 2019 Jan 08, 2019

Correct. Though as Manan mentioned, insertionPoints is not a character but, well, an insertion point. If you click between two characters then that blinking small vertical bar (aka as the cursor') is the insertion point. The last character in a frame is textFrame.characters[-1].

P.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 08, 2019 Jan 08, 2019
LATEST

Also, an entirely blank text frame contains no characters at all – but it still has one Insertion Point. Else you could not add text to it.

(The same is true for footnotes and table cells.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines