Copy link to clipboard
Copied
Any scripts or add ons for formatting indexes? I am supplied indexes direct from the authors in Word - and they never come as they should do.
Example here:
D’Orbay, François, ix, 57, 90, 91, 102, 103, 117, 118, 119, 121, 122, 124, 126, 133, 145, 150, 169, 172, 173, 174, 176, 179-180, 181-182
Needs to look like:
D’Orbay, François, ix, 57, 90–1, 102–103, 117–19, 121–2, 124, 126, 133, 145, 150, 169, 172–4, 176, 179–2
Its a pain having to manually go through and correct the page ranges. Must be an easier way to do it. Any ideas?
Copy link to clipboard
Copied
Hi @Matthew5C62,
At the scripting level you can use the PageRange module from IdExtenso once you have at hand the original sequence of page numbers.
In order to use this solution, you need to include two files:
So your script will look like
#include 'path/to/$$.bin.230518.jsx'
#include 'path/to/etc/$$.PageRange.jsxlib'
$$.load();
// Here you specific code,
// and at some point:
formattedRange = $$.PageRange(originalRange, /*options*/);
// etc . . .
$$.unload();
The options of $$.PageRange.format(…) are detailed here.
Note. — format is the “automatic” method of the module, so $$.PageRange(…) is just a shortcut of $$.PageRange.format(…).
Best,
Marc