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?
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.
- 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
...Copy link to clipboard
Copied
Try:
app.activeDocument.stories.tables
Style 1")
app.activeDocument.stories.tables
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>
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"
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>
Copy link to clipboard
Copied
again: Object does not support the property or method "tableStylesGroup"
Copy link to clipboard
Copied
Sorry.
tableStyleGroups
Copy link to clipboard
Copied
Doesn't work.
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.
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 [...]
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.
Copy link to clipboard
Copied
Yes, the Style Group exist:
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).
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
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>
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.
- 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!
Copy link to clipboard
Copied
I'm answering from my phone (Gmail app).