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

Change font size of an table with javascript

New Here ,
May 12, 2011 May 12, 2011

Copy link to clipboard

Copied

Hello!

i am new to developing in javascript as well as to indesign. i have to make a few changes to an existing script. in a user dialouge i get the font size in which the imported table should be. but how can i change the font size of an table???

please respond as soon as possible. thanks very much in advance.

moketas

TOPICS
Scripting

Views

2.9K
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

Contributor , May 12, 2011 May 12, 2011

Hi

do you want do like this (rightside) ?

To apply font to each cell, you must access TextFrame => Table => Cell => any TextObject

tablefont.png

var doc = app.documents[0];

// two textframes, they have a table (2x2)
var tf_one = doc.textFrames[0];
var tf_two = doc.textFrames[1];


//applied to story
tf_one.parentStory.appliedFont = "Myriad Pro\tLight";
tf_one.parentStory.pointSize = 24;
//not effective against table text

//applied to text-object of each cells of table
tf_two.parentStory.tables[0].cells.everyI
...

Votes

Translate
Contributor ,
May 12, 2011 May 12, 2011

Copy link to clipboard

Copied

LATEST

Hi

do you want do like this (rightside) ?

To apply font to each cell, you must access TextFrame => Table => Cell => any TextObject

tablefont.png

var doc = app.documents[0];

// two textframes, they have a table (2x2)
var tf_one = doc.textFrames[0];
var tf_two = doc.textFrames[1];


//applied to story
tf_one.parentStory.appliedFont = "Myriad Pro\tLight";
tf_one.parentStory.pointSize = 24;
//not effective against table text

//applied to text-object of each cells of table
tf_two.parentStory.tables[0].cells.everyItem().texts[0].appliedFont = "Myriad Pro\tBold";
tf_two.parentStory.tables[0].cells.everyItem().texts[0].pointSize = 24;

thank you

mg.

Votes

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