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

Trying to understand document creation using JS

Explorer ,
Jan 02, 2017 Jan 02, 2017

Copy link to clipboard

Copied

Hello,

I’m currently exploring the InDesign scripting capabilities using the InDesign CS6 Javascript Scripting Guide and the Scripting Tutorial​. Are there other documents that you would recommend, besides the example scripts in the SDK?

After reading through them and looking at the code, I do have a few questions and I hope that the community here can help me clarify them. Assume I’ve created a new document and a master spread following the examples in the Scripting Tutorial, pages 29 through 37.

  1. When I add a number of paragraphs, then each paragraph is terminated by a \r character, correct?
  2. It also seems that adding a large number of paragraphs automatically creates new pages, each of which contains its own TextFrame, correct?
  3. As I populate the document with paragraphs, is there a way to set the style for a paragraph and then add the paragraph, or do I have to add the paragraph first and only then can I modify its style?
  4. As I populate the document with paragraphs, how do I keep track of the last paragraph so that I can keep adding after the last one? It looks like InDesign’s object model of pages and text frames does not offer a plain linear view of the added text? (See page 79 of Javascript Scripting Guide.)
  5. Similarly to 3. and 4. but in the context of the text content of a paragraph:
    1. It looks like paragraph.words[] is the way to access the content of a paragraph?
    2. How do I incrementally add text content to a paragraph and style that content? Add first, then select a number of words, then apply a style; or can I change style, then add words in that style, then change and continue with a default style?
  6. How do I insert a page break?
  7. How do I mark some text as a clickable external URL?
  8. Is it possible to mark up some text (words) and associate a comment or pop-over with them, information that does not belong to the actual content of the document?

For now that’s all, although I do have a few more questions...

Jens

TOPICS
Scripting

Views

813

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
Community Expert ,
Jan 02, 2017 Jan 02, 2017

Copy link to clipboard

Copied

Hi Jens,

I would recommend reading some books while experimenting with code.

See e.g. this one in German language by Gregor Fellenz:

InDesign automatisieren | Keine Angst vor Skripting, GREP & Co.

Regards,
Uwe

Votes

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
Community Beginner ,
Jan 02, 2017 Jan 02, 2017

Copy link to clipboard

Copied

Hi all,

are there some books in english

Regards,
Saeed

Votes

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
Community Expert ,
Jan 02, 2017 Jan 02, 2017

Copy link to clipboard

Copied

Hi Saeed,

for ExtendScript in English I see Grant Gamble's book:

InDesign CS5 JavaScript Paperback – June 29, 2011

Or Peter Kahrel's book:

Scripting InDesign CS3/4 with JavaScript – Updated for CS5: August 2010

See also Jongware's:

http://indesignsecrets.com/javascript-for-the-absolute-beginner.php

For DOM documentation InDesign, InCopy and InDesign Server up to CS6

(also older versions of Adobe Illustrator, Adobe PhotoShop and FrameMaker):

Indesign JavaScript Help

Gregor Fellenz' DOM documentation:

InDesign ExtendScript API (8.0)

InDesign ExtendScript API (10.0)

InDesign ExtendScript API (11.0)

If you want to gather your own DOM documentation—e.g. InDesign CC version 9 that is not covered above—see this:

GitHub - grefel/extendscriptApiDocTransformations: Transformations for Adobe ExtendScript API Docume...

Regards,
Uwe

Votes

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
Community Beginner ,
Jan 02, 2017 Jan 02, 2017

Copy link to clipboard

Copied

Thanks , Uwe.

i will read them

Regards,
Saeed

Votes

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
Community Expert ,
Jan 03, 2017 Jan 03, 2017

Copy link to clipboard

Copied

LATEST

Hey Uwe,

Thanks for mentionining my DOM documentation.

Please not the link http://www.indesignjs.de/extendscriptAPI/indesign-latest/ to the latest version (for now 12 - CC 2017). In my opinion this is the link to bookmark, the versioned links will not update.

Viele Grüße,

Gregor

Votes

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