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

Making tables in Indesign with Applescript

New Here ,
Sep 14, 2017 Sep 14, 2017

Hi,

I am working on a script for InDesign and apart of the script involves creating a table.  Everything is working well, except for the creation of my table.  I think I may have missed a few steps along the way.  Can anyone help?  The scripting guide states that a table can be created at an insertion point of a story.  I think this is the part that I am missing.

I tried to create a text frame and then insert the table into the text frame.  When I enter the following code from the reference guide, I get an error. 

tell insertion point -1

set myTable to make table

set column count of myTable to 3

set body row count of myTable to 3

end tell

Thanks in advance!

TOPICS
Scripting
1.4K
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
Enthusiast ,
Sep 15, 2017 Sep 15, 2017

Hi,

You can get a reference to an insertion point using (1)  reference to an insertion point in a story; or (2) using the selection list object:

(1) reference to insertion point in a story

tell application "Adobe InDesign CC 2017"

  tell document 1

  tell story -1

  set insPt to insertion point 1

  end tell

  tell insPt

  set myTable to make table with properties {column count:3, body row count:3}

  end tell

  end tell

end tell

(2)

tell application "Adobe InDesign CC 2017"

  set selList to selection

  if class of item 1 of selList is insertion point then

  set insPt to item 1 of selList

  tell insPt

  set myTable to make table with properties {column count:3, body row count:3}

  end tell

  end if

end tell

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 Beginner ,
Dec 18, 2018 Dec 18, 2018
LATEST

Check this link to create a table

CREATE A TABLE IN INDESIGN USING JAVASCRIPT

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