Copy link to clipboard
Copied
Dear script kings,
I was workout the script for based on the table (xml workflow).
I was done the script automatically apply paragraph style in the table. below my coding.
allTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
for (aTable=0; aTable<allTables.length; aTable++)
{
var myTable = allTables[aTable];
if(myTable.rows.length >1)
{
myTable.autoTag();
for (rw=0; rw<myTable.rows.length; rw++)
{
if(rw==0)
{
myTable.rows[rw].cells.everyItem().paragraphs[0].appliedParagraphStyle ="Table head";
}
else
{
myTable.rows[rw].cells.everyItem().paragraphs[0].appliedParagraphStyle ="Table Text";
}
}
}
}
This working fine.
@ I needed; How to add xml tagging <p> in the paragraph styles for "Table head" and "Table Text"? This is possible to script. please help and suggest me dear friends.
Advance Thanks all.
Copy link to clipboard
Copied
Hi
You need to map styles to tags but first state the associations:
var doc = app.activeDocument;
var tag = doc.xmlTags.item("p");
var style = doc.paragraphStyles.item("Table head");
var map = doc.xmlImportMaps.add(tag,style);
doc.mapStylesToXMLTags();
HTH
Loic
Copy link to clipboard
Copied
Hi Loic.Aigon‌,
Thanks your response,
Your coding working with foot_note text and all tags creating with out of xml structure. But, i need to insert the tag for inside of tables (attached screenshot for your reference).
@ just about: i think, here with problem for "xmlImportMaps"? please give other way (solution) friend.
One more thanks,
Copy link to clipboard
Copied
Just checked here. Also working inside tables. What InDesign version do you have ?
Copy link to clipboard
Copied
Hi Loic.Aigon,
First, thanks for your help.
@ Here with i am using; Mac indesign CS6 version 8.0. also attached screenshot for your reference.
Again try your above coding. But, not working properly totally my xml structure is change (sorry for saying). Please suggest me Loic.Aigon.
Advance thanks,
Copy link to clipboard
Copied
There were several bug fix versions of InDesign CS6. Maybe that would explain the difference?
What is your exact version?
Hold down the cmd key and chose "About inDesign..." to see the exact version number.
My version of CS6 on Mac OSX is 8.1.0.419.
Uwe
Copy link to clipboard
Copied
HI Laubender
I have attached screenshot based on the your comment friends. Please check and tell me one good solution.
DB File Version: 8.0
Advance Thanks.
Copy link to clipboard
Copied
I would second Uwe's answer. Check any possible updates available for your InDesign CS6.
If still not working, you can still reach the text object inside cell, look at the applied style and append a tag to that text object.
Or do a GREP search with applied style option and look if found text parent is a cell and then append the tag to the text object.
please give other way (solution) friend
Open the manual ?
Loic
Copy link to clipboard
Copied
Hi Loic.Aigon,
OK, i will try your suggestion and get back to you.
Thanks