|
![]() |
#1 |
Member
Join Date: Jan 2005
Posts: 103
|
![]()
I'm working on a script to do cross-references within any InDesign CS document. The script is a JavaScript and will work on either platform. I have it working sufficient to my own needs for the project I'm working on, but I'm thinking that this script has potentially broad appeal and applicability, so I'm seeking guidance on some functionality issues that might enhance the script for others to use. Here's a brief statement of what it does:
Cross references have two forms: Raw and Processed. A Raw cross reference is text only within any story in the active document in a character style named Xref. The text should be the name of a linked graphic (sans extension). For example, in the project I'm working on my client provided me with a raw cross reference that looked like this: (shown on page fig14-3w) where " fig14-3w" was in the style Xref. The client actually made a mistake here. The space should not have been in the style but my script is smart enough to notice that and change the space back to no character style. A Processed cross reference takes the form of a text frame that replaces the Xref text, sitting inline in the paragraph on the baseline. It contains the page number in the same text style as the paragraph and has the character style Xnum applied to it -- up to you whether or not the Xnum style does anything to the text. [By the way, the script will create that style if it doesn't already exist, in which case it will do nothing to the text. So, the above Raw cross reference becomes: (show on page 391) where 391 is actually a text frame. As such, you can select it and when you do, in the Script Label palette you'll see: Xref = fig14-3w This allows you to correct mistakes (e.g., the client actually typed Fig14-3w but the case-sensitive name is fig14-3w) or redirect an existing cross reference to some other figure. Every time the script runs, it converts any Raw cross references to the Processed form and then updates all the Processed ones, so, if you've changed the page numbers or reorganized your document, the reference is corrected. If a referenced link can't be found, the script puts ??? as the page number in the Xnum style, so you can quickly find and repair any such erroneous references by editing the Script Label. It also alerts you that you need to do this. So, for those of you who've had the patience to read this far, does this sound useful to other people? And, more specifically, what should I do about Section Prefixes? Strip them out? Leave them in? Offer a Preferences feature? I welcome any feedback. Dave |
![]() |
![]() |
![]() |
#2 |
Sysop
Join Date: Oct 2004
Posts: 10,478
|
![]()
This is on some level a bit beyond me and my limited experience with ID and so my comment may not be relevant...
When you say "where 391 is actually the text frame..." Does this imply that there is a one to one correspondence between text frame and page? Can't you have more than one text frame on a page and if so, does that muck things up? Other than that, it seems like it would be a very useful tool... Terrie |
![]() |
![]() |
![]() |
#3 |
Sysop
Join Date: Oct 2004
Location: Subtropical Queensland, Australia, between the mountains and the Coral Sea
Posts: 4,592
|
![]()
Is it designed to be run immediately before packaging and sending to the printer, so that all references are correct without the need for time-consuming and error-prone human checking?
I can see it being very useful for academic work and software manuals (both vendor and third party) or even professional journals; anywhere where the various articles/chapters are created separately and joined up, or peer review requires changes that may affect pagination. And if the situation you found yourself in justified the time spent creating and testing it, then I imagine others will have found themselves in similar situatiions, without your skill in developing a solution. __________________ ![]() |
![]() |
![]() |
![]() |
#4 |
Member
Join Date: Jan 2005
Posts: 103
|
![]()
I guess I didn't express that as well as I might have. Doing this kind of thing with a script requires that the target be easily identifiable -- that's why I limit it to linked graphics (of course, you could play the "invisible GIF" game and put targets anywhere you like).
More important, the reference needs to not only be easy to find but needs to carry withit the identity of what it is pointing at. So, I create a text frame to put the reference in. It's an inline frame, so it will move with the text around it if you edit or reorganize your document. And I use the frame's label to not only tell my script what it's supposed to be pointing at but also the user (via the script label palette). You can have as many as you like on a page and you can point at as many items as you like. On my iMac/20 (G4 - 1.25Mhz) it takes about .35 seconds per reference in a document with 308 links to 108 external graphics over 40 pages. One thing I have realized that I've given no thought to at all is what to do if editing/reorganizing a document results in the target being on the same page as the reference. Perhaps I could use "above" or "below" based on the geometric bounds of the reference and the target, but that would make it quite challenging for the user to come up with a wording that works for either of these or a page number. I'll have to chew on that some more. Dave |
![]() |
![]() |
![]() |
#5 |
Member
Join Date: Jan 2005
Posts: 103
|
![]()
It runs quite quickly (I improved its speed by a factor of 100+ between yesterday and today). It processes about three references a second.
I see myself running it every time I send a PDF whether as a proof or for printing. Dave |
![]() |
![]() |
![]() |
#6 |
Member
Join Date: Jan 2005
Posts: 103
|
![]()
If anyone is interested in helping me alpha-test this, I have put together a package with a 2-page user guide which I'll e-mail (it's a 56K zip file). The fact that I found (and fixed) three bugs while writing the user guide makes me cautious about distributing it too far at this stage.
Send an e-mail to XrefAlphaTest@pdsassoc.com and I'll get back to you with the package. Reminder: this is a JavaScript for InDesign CS. It does not work with InDesign 2.x or earlier. Dave |
![]() |
![]() |
![]() |
#7 |
Member
Join Date: Jan 2005
Posts: 103
|
![]()
A long overdue update (people keep e-mailing me when they find this topic):
I abandoned further development of this effort because it turned out that in the whole 864-page book, I used this script on one page only. The one that caused me to think that a script would be a good idea! However, there is good news. I have since done a similarly-sized catalog that had well over 2,000 cross-references in it. I used a script by Teus de Jong for this. You can find it at: http://www.teusdejong.nl/ under InDesign utilities. Or directly download the package (which includes a tutorial) from: http://www.teusdejong.nl/indesign/crossrefs.zip Dave |
![]() |
![]() |
![]() |
#8 | |
Founding Sysop
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,187
|
![]() Quote:
__________________ [SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE] [SIGPIC][/SIGPIC] |
|
![]() |
![]() |
![]() |
#9 |
Member
Join Date: Jan 2005
Posts: 103
|
![]()
Hi KT,
Well, but jet-lagged -- got in from England late last night after two weeks, the center-point of which was our niece's wedding, but this did mean I was able to fit in a day at the InDesign Conference last week. Dave |
![]() |
![]() |
![]() |
#10 | |
Founding Sysop
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,187
|
![]() Quote:
__________________ [SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE] [SIGPIC][/SIGPIC] |
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Font name cross references | Norbert | Fonts & Typography | 5 | 12-14-2005 08:15 PM |
Page # references? | Molly/CA | Print Production & Automation | 19 | 09-28-2005 05:03 PM |