Question
Script to modify paragraph styles based on user-selected input value
Hi,
I'd appreciate any help with the following. First, I'll describe the problem, to estabish context and also open the door for anyone who has a better suggestion than my proposed solution.
The Problem
- I produce a large range of product documents (user guides, product inserts etc) which use a consistent set of styles. The styles are maintained in their own InDesign document. Every time I edit a document, first thing I do is re-import all the styles, to make sure it's got the latest. This is cumbersome but I don't know of any other way to keep them all in sync.
- Several paragraph stylesheets (currently: 4) have numbering styles that contain text prefixes: Appendix, Chapter, Table, and Figure. (Each has its own list style.)
- Once the English version of a document is ready, it goes to our outsourced translation service. I give them a separate copy of the English 'source document' for each target language. We currently have 4 languages other than English but that will increase over time.
- The translators have standing instructions to translate the text prefixes in those stylesheets (so 'Table' becomes 'Tabla' in Spanish). But the next time that document is modified (for any reason), I will reimport the stylesheets—thus resetting 'Tabla' to 'Table'.
Proposed Solution
- A script that contains preconfigured sets of prefixes (Appendix, Chapter, Table, and Figure) in each language. I would modify this whenever we add a language. Although I don't know InDesign scripting, I'm familiar with concepts such as variables from other scripting languages like VBA.
- When it is run, the script could pop up a dialog allowing me to choose the language. It would then use that set of prefixes to modify the relevant stylesheets.
- The proposed workflow: before sending a document for translation, I would first reimport all the styles, then run the script. The translators would receive a document with those terms already translated. The same would happen if the document needs to be modified subsequently (for example, whenever I tweak a stylesheet in my common set, I have to reimport them back into every document, though I don't do this until the next time I modify each document).
Apologies for the lengthy description but I thought it would be helpful to understand the context, especially as I can't be sure the proposed solution is the best one (or even a good one).
Cheers,
--Alistair
