TOC parameter

Advertisement

TOC parameter
Hi Genius,
Could anyone help how to save the TOC parameter in the variable that already defined in the active document.
My request need to save the parameters for the following entries:
1. Entry Style
2. Page Number
3. Between Entry and Number
4. etc....
Trying coding is below:
//Working fine
var myTocStyle = app.activeDocument.tocStyles.item(-1).name;
alert("myTocStyle: " + myTocStyle)   
var myTitleStyle = app.activeDocument.tocStyles.item(-1).titleStyle.name;
alert("myTitleStyle: " + myTitleStyle)  
//Not working
var myFormatStyle = app.activeDocument.tocStyleEntries.formatStyle.name;
alert("myFormatStyle: " + myFormatStyle)
var myPageNumber = app.activeDocument.tocStyleEntries.pageNumberPosition;
alert("myPageNumber: " + myPageNumber)
var mySeperator = app.activeDocument.tocStyleEntries.separator;
alert("mySeperator: " + mySeperator)
Please help for my urgent request.
Thanks
Beginner_X
Repaly
Hi Jump,
Thanks for your immediate response...
I tried your code, but it not works for me, may I did mistake, please clear my code
var myTocStyle = app.activeDocument.tocStyles.item(-1).name;
alert("myTocStyle: " + myTocStyle)
//~ var myPageNumber = myTocStyle.tocStyleEntries.itemByName("FM_H1").pageNumberPosition;   //Jump_Over Code
//~ var myPageNumber = myTocStyle.tocStyleEntries.item(0);
alert("myPageNumber: " + myPageNumber)
//~ var myEntryStyle = myTocStyle.tocStyleEntries.item(0).formatStyle.name;
var myEntryStyle = myTocStyle.tocStyleEntries.formatStyle.name;
alert("myEntryStyle: " + myEntryStyle)
Output that I need is:
As per my attachment, in above line (alert for myEntryStyle) should be "FM_H1" style. Then i got the output.
Thanks in advance
Beginner
Read More: The other 6 answers