Thanks, looks good.
I have not run scripts within inDesign.
I modified L 13 to specify my defined character style for the item class for which I want to add entries to index.
ExtendScript tool is running on my Mac. I deleted the comments, "Laufbar in CS3, 4, 5", etc. Now it is hung on line 45 "var myCharStyles = doc.characterStyles.everyItem().name", with comment at bottom, "Undefined is not an object".
Where and how do I point the JS script to my iD document? Should the document be open or closed in iD?
Look in the upper left of the ExtendScript window and there will be a dropdown list which probably says ExtendScript ### (version that is running). Use that list to select the version of ID you are running and try again.
In inDesign, I established a character style for index entries, and set several text strings to that style. Then reopened the script in extendScript application.
Dropdown contained all Adobe apps on my Mac that are capable of running JS. Chose inDesign. The script appeared to run successfully. Then looked in my active document's Index but found no entries.
Is there any output processing to be done after running the script?
Have you tried running the script from within ID with the document active?
iD is open and the document is active. Found the Scripts button and dropdown found my js file quite readily (v. impressive btw).
As stated, I created a character style named 'figCaption' and added that name in the appropriate place in the script.
At runtime I get the error Number 2 with Error String: figCaption is undefined.
Last line of error message: Source: app.findTextPreferences.appliedCharacterStyle = figCaption;
Question: In the js file, should I surround the style name in quotes? Single? Double?
The way the script is set up is to create a dropdown list in a dialog and you select the Character Style there. Don't put a named style hard wired into the script.
Rechecked, and the default value (myCharacterStyle) is actually in the copy of the script that I am running. The dropdown comes up with the correct value of the character style. After I click OK, the error message appears as quoted earlier.