0

Is there a script command that can reassign the adobe paragraph composer to 'World paragraph composer'?

The InDesign ExtendScript API(12.0) does not seem to have a command.

I basically want to change the type of composer in multiple documents (basically in multiple books. Each book containing approximately 50 documents).

1

You can set the composer by writing to a story's (or another text item's) composer property. The tricky part is to find out what to set it to, as this is also dependent on your locale and differs if you use international versions of InDesign. That's why you need to resort to language independent identifiers. There are scripts out there that can generate all these identifiers for you, however, if you just need this one for the composer property, here you go:

myStory.composer = "$ID/HL Composer Optyca";  // world paragraph composer

// or alternatively, here are the other three common composer values
// myStory.composer = "$ID/HL Single Optyca";  // world single line composer
// myStory.composer = "$ID/HL Composer";  // Adobe paragraph composer
// myStory.composer = "$ID/HL Single";  // Adobe single line composer
| improve this answer | |
  • What does $ID/HL mean? – One Face May 24 at 1:49
  • There are multiple stories in each document. But the text is contained in only one story. Is there a way to apply the composer for the entire document? – One Face May 24 at 1:53
  • 1
    Sure, get all the stories of the document (myDoc.stories) and then just loop over them and assign the the composer value to each one. Not idea what HL in $ID/HL actually stands for. – mdomino May 24 at 15:18
  • I did a document.ChangeComposer() which automatically changed the composer to world paragraph composer. Will the locale affect this function? – One Face May 25 at 4:54
  • 1
    Interesting, didn't know about this method. This seems not to allow any parameters and always sets it to "optyca" which corresponds to world format. This would then be locale independent. So, in this specific case, this method should be the fastest for your purposes, I guess. – mdomino May 25 at 18:55
0

There is an property called Composer in multiple classes of the API that allows changing the composer.

The Paragraph class, Story class, etc... has this property.

The Document class does not seem to have this Composer property. However, it has a method called changeComposer(). On applying this method, the composer changed to Adobe World-Ready Paragraph Composer.

Hope this helps

| improve this answer | |
  • A few notes: Using the string "Adobe World-Ready Paragraph Composer" does work language independent. This might of course not be a problem, if you only ever use a US english version. Going via app.changeGrepPreferences.composer is probably much slower then setting the value of a paragraph directly. And lastly, if you need to change entire documents, it will be much faster to change these properties in regard to the stories, not each single paragraph, as a story is the largest text entity in an InDesign document, so will need to change fewer of those. See my answer for details. – mdomino May 23 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.