Copier le lien dans le Presse-papiers
Copié
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
...Copier le lien dans le Presse-papiers
Copié
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>
Copier le lien dans le Presse-papiers
Copié
Thanks, but this doesn't seem to work either. ESTK throws an error: Object does not support the property of method "tableStyleGroup"
Copier le lien dans le Presse-papiers
Copié
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>
Copier le lien dans le Presse-papiers
Copié
again: Object does not support the property or method "tableStylesGroup"
Copier le lien dans le Presse-papiers
Copié
Sorry.
tableStyleGroups
Copier le lien dans le Presse-papiers
Copié
Doesn't work.
Copier le lien dans le Presse-papiers
Copié
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.
Copier le lien dans le Presse-papiers
Copié
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 [...]
Copier le lien dans le Presse-papiers
Copié
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.
Copier le lien dans le Presse-papiers
Copié
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).
Copier le lien dans le Presse-papiers
Copié
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>
Copier le lien dans le Presse-papiers
Copié
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!
Copier le lien dans le Presse-papiers
Copié
I'm answering from my phone (Gmail app).
Trouvez plus d’idées, d’événements et de ressources dans la nouvelle communauté Adobe
Explorer maintenant