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

Apply Table style contained in TableStyleGroup

Explorer ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

Hi I am trying to apply Table style to all Tables in the story:

    for (s=0; s<app.activeDocument.stories.length; s++) 

    for (t=0; t<app.activeDocument.stories.tables.length; t++) 

    { 

         app.activeDocument.stories.tables.TableStyleGroup.itemByName("Group").TableStyle.itemByName("Table Style 1")

         app.activeDocument.stories.tables.clearTableStyleOverrides(); 

    } 

What am I doing wrong?

TOPICS
Scripting

Views

783

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

Explorer , May 19, 2017 May 19, 2017

lf.corullon  wrote

What exactly do you want to do?

Your main code is doing anything.

The script shows an error? Or simply do anything?

You want to select the table and set a style to be applied.

  1. app.activeDocument.stories.tables.appliedTableStyle = app.activeDocument.tableStyleGroups.itemByName("Group").tableStyles.itemByName("Table Style 1");

I just copied the line from the script you supplied and it seem to be working now!

I don't know what browser do you use, or what is happening when you copying

...

Votes

Translate

Translate
Enthusiast ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

Try:

app.activeDocument.stories.tables.tableStyleGroup.itemByName("Group").tableStyles.itemByName("Table

Style 1")

app.activeDocument.stories.tables.clearTableStyleOverrides();

Em 19 de mai de 2017 10:55 AM, "Peter Stnsz" <forums_noreply@adobe.com>

escreveu:

Adobe Community <https://forums.adobe.com/?et=watches.email.thread>

Apply Table style contained in TableStyleGroup

criado por Peter Stnsz

<https://forums.adobe.com/people/Peter+Stnsz?et=watches.email.thread> em *InDesign

Scripting* - Visualize a discussão completa

<https://forums.adobe.com/message/9525286?et=watches.email.thread#9525286>

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
Explorer ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

Thanks, but this doesn't seem to work either. ESTK throws an error: Object does not support the property of method "tableStyleGroup"

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
Enthusiast ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

tableStylesGroup

Em 19 de mai de 2017 11:23 AM, "Peter Stnsz" <forums_noreply@adobe.com>

escreveu:

Adobe Community <https://forums.adobe.com/?et=watches.email.thread>

Apply Table style contained in TableStyleGroup

resposta de Peter Stnsz

<https://forums.adobe.com/people/Peter+Stnsz?et=watches.email.thread> em *InDesign

Scripting* - Visualize a discussão completa

<https://forums.adobe.com/message/9525293?et=watches.email.thread#9525293>

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
Explorer ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

again: Object does not support the property or method "tableStylesGroup"

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
Enthusiast ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

Sorry.

tableStyleGroups

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
Explorer ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

Doesn't work.

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
Enthusiast ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

What exactly do you want to do?

Your main code is doing anything.

The script shows an error? Or simply do anything?

You want to select the table and set a style to be applied.

  1. app.activeDocument.stories.tables.appliedTableStyle = app.activeDocument.tableStyleGroups.itemByName("Group").tableStyles.itemByName("Table Style 1");

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
Explorer ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

As mentioned in my first post, the script applies Table style to all Tables in the document (same like here: Apply a table style to all tables in the document

Whenever I try your suggestion to place: tableStyleGroups, tableStylesGroup etc. I am getting an ESTK error Object does not support the property or method [...]

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
Enthusiast ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

Does the table group name you put in the code really exists? Does the table

style name you put in the code really exists?

In the code Jongware writes in the mentioned topic, you must replace "tabs"

by the right path to the table style. As I made in my last reply.

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
Explorer ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

Yes, the Style Group exist:

Screen Shot 2017-05-19 at 16.03.01.png

The Jongware method works Perfectly ("tabs" is only his name for The Table style - you can rename it accordingly to your Table Style and it still works, The problem is once you have a Table Style inside the Group).

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
Enthusiast ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

I know, my friend.

But, because your style is within a group, you must to write the entire

"path" to the style.

1. app.activeDocument.stories.tables.appliedTableStyle =

app.activeDocument.tableStyleGroups.itemByName("Group"

).tableStyles.itemByName("Table Style 1");

I tested here and it's working.

Em 19 de mai de 2017 12:05 PM, "Peter Stnsz" <forums_noreply@adobe.com>

escreveu:

Adobe Community <https://forums.adobe.com/?et=watches.email.thread>

Apply Table style contained in TableStyleGroup

resposta de Peter Stnsz

<https://forums.adobe.com/people/Peter+Stnsz?et=watches.email.thread> em *InDesign

Scripting* - Visualize a discussão completa

<https://forums.adobe.com/message/9525466?et=watches.email.thread#9525466>

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
Explorer ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

lf.corullon  wrote

What exactly do you want to do?

Your main code is doing anything.

The script shows an error? Or simply do anything?

You want to select the table and set a style to be applied.

  1. app.activeDocument.stories.tables.appliedTableStyle = app.activeDocument.tableStyleGroups.itemByName("Group").tableStyles.itemByName("Table Style 1");

I just copied the line from the script you supplied and it seem to be working now!

I don't know what browser do you use, or what is happening when you copying/pasting/writing the code on the forum it appeared to be broken in your previous posts!

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
Enthusiast ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

LATEST

I'm answering from my phone (Gmail app).

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