-
1. Re: Index Entries from Figure Captions
Obi-wan Kenobi Apr 5, 2014 7:23 PM (in response to Jack)Hi,
Take a look to:
http://indesign.hilfdirselbst.ch/text/indexeintrage-auf-der-basis-von-zeichenformaten.html
Fine [JS] written by Martin Fischer.
-
2. Re: Index Entries from Figure Captions
Jack Apr 6, 2014 3:01 PM (in response to Jack)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?
-
3. Re: Index Entries from Figure Captions
Larry G. Schneider Apr 6, 2014 8:12 PM (in response to Jack)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.
-
4. Re: Index Entries from Figure Captions
Jack Apr 7, 2014 5:14 PM (in response to Larry G. Schneider)That helped.
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?
-
5. Re: Index Entries from Figure Captions
Larry G. Schneider Apr 7, 2014 5:16 PM (in response to Jack)Have you tried running the script from within ID with the document active?
-
6. Re: Index Entries from Figure Captions
Jack Apr 7, 2014 5:37 PM (in response to Larry G. Schneider)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?
-
7. Re: Index Entries from Figure Captions
Larry G. Schneider Apr 7, 2014 5:57 PM (in response to Jack)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.
-
8. Re: Index Entries from Figure Captions
Jack Apr 7, 2014 7:48 PM (in response to Larry G. Schneider)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.



