Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Insertion texte en extendScript

New Here ,
Jul 22, 2021 Jul 22, 2021

Copy link to clipboard

Copied

Hello,

I am looking for an extendScript syntax for Indesign that can insert the text "PageHeader" in a paragraph of each page. My document is long and all the blocks are linked. The purpose is to transform them into ID for an index match via a VBA under word. I usually place this text one by one. This syntax would make my job easier. If anyone can help me. Thank you

 

Moving from Using the Community (which is about the forums) to the correct forum... Mod
To ask in the forum for your program please start at https://community.adobe.com/

TOPICS
How to

Views

59

Likes

Translate

Translate

Report

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

Adobe Community Professional , Jul 23, 2021 Jul 23, 2021
The following snippet will add the text at the start of the first paragraph. To run it select the textframe in which you want to add the text var tf = app.selection[0] tf.paragraphs[0].insertionPoints[0].contents = "PageHeader " To change the position of insertion you can change the index of the insertionPoints collection. -Manan

Likes

Translate

Translate
Adobe Community Professional ,
Jul 22, 2021 Jul 22, 2021

Copy link to clipboard

Copied

Hi @Thierry Poulet,

Some questions

  • How to identify the paragraph in which this text is to be inserted?
  • At what position in the paragraph is the insertion to be made?

-Manan

Likes

Translate

Translate

Report

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
New Here ,
Jul 22, 2021 Jul 22, 2021

Copy link to clipboard

Copied

Hello Manan and thank you for your help,

Mon texte doit-être positionné n'importe où dans le premier paragraphe du bloc. Ce texte va être transformé en <span class="index" href="#index_0xxx"></span> donc invisible.

Thierry

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

The following snippet will add the text at the start of the first paragraph. To run it select the textframe in which you want to add the text

var tf = app.selection[0]
tf.paragraphs[0].insertionPoints[0].contents = "PageHeader "

To change the position of insertion you can change the index of the insertionPoints collection.

-Manan

 

Likes

Translate

Translate

Report

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
New Here ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

LATEST

Super !

Merci beaucoup pour ton aide. Je vais tenter avec ça de faire une boucle afin d'automatiser la procédure.

Je t'envoie le résultat dès que j'aurais fini.

Encore merci

Amicalement

Thierry

Likes

Translate

Translate

Report

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