Set composer in InDesign script independent of locale

Explorer ,
Oct 02, 2019 Oct 02, 2019

Copy link to clipboard

Copied

Hi there,

I am trying to set a story's composer to Adobes single line composer via a script. The issue I have that I am running in a German locale and that I seem to be unable to use the English string to make the script work in all language environments.

myStory.composer = "Adobe Single-line Composer";  // -> throws an error

 Anybody knows how to set it in a way that it recognizes the string in any environment?

Thank you!

TOPICS
Scripting

Views

334

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Explorer , Oct 02, 2019 Oct 02, 2019

Marc Autret (@indiscripts) kindly provided the answer over at Twitter:

myStory.composer = "$ID/HL Single";

 

Likes

Translate

Translate
Adobe Community Professional , Oct 02, 2019 Oct 02, 2019

Hi MasterDomino,

here all strings for composers that I am aware of for InDesign CS6 and above:

 

Paragraph composers:

$ID/HL Single
$ID/HL Composer

 

Adobe World-Ready Composers:

$ID/HL Single Optyca
$ID/HL Composer Optyca

 

Japanese Composers:

$ID/HL Single J
$ID/HL Composer J

 

How can you get the strings?

With a German InDesign you could ask with app.findKeyStrings() like that:

// Example: German InDesign
// Provided string is the German version of Adobe World-Ready Paragraph Composer

var myString = "Globale
...

Likes

Translate

Translate
Explorer ,
Oct 02, 2019 Oct 02, 2019

Copy link to clipboard

Copied

Marc Autret (@indiscripts) kindly provided the answer over at Twitter:

myStory.composer = "$ID/HL Single";

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 02, 2019 Oct 02, 2019

Copy link to clipboard

Copied

Hi MasterDomino,

here all strings for composers that I am aware of for InDesign CS6 and above:

 

Paragraph composers:

$ID/HL Single
$ID/HL Composer

 

Adobe World-Ready Composers:

$ID/HL Single Optyca
$ID/HL Composer Optyca

 

Japanese Composers:

$ID/HL Single J
$ID/HL Composer J

 

How can you get the strings?

With a German InDesign you could ask with app.findKeyStrings() like that:

// Example: German InDesign
// Provided string is the German version of Adobe World-Ready Paragraph Composer

var myString = "Globaler Adobe-Absatzsetzer";

app.findKeyStrings(myString);
// Result is an array that contains 
// "$ID/HL Composer Optyca"

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 02, 2019 Oct 02, 2019

Copy link to clipboard

Copied

Ah, thanks Uwe. That's really good to know, will add this to my snippets collection.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 30, 2022 Jul 30, 2022

Copy link to clipboard

Copied

Hi @Laubender 

I tried to change it to middle east version composer, its Adobe World-Ready Paragraph Composer but i cant identify the composer ID for the Middle East (ME Version), text string written in arabic :

var myString = "أدوبي انديزاين";
var myIDKey = app.findKeyStrings(myString);
$.writeln(myIDKey);

 

Best
M.Hasanain

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 01, 2022 Aug 01, 2022

Copy link to clipboard

Copied

Hi @M.Hasanain ,

the two strings for the ME Adobe World-Ready Composers are:

 

$ID/HL Single Optyca
$ID/HL Composer Optyca

 

So this should work:

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

 

I cannot test with the ME version so I cannot answer your question about app.findKeyStrings().

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

Thank you very much @Laubender 

Best
M.Hasanain

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 08, 2022 Aug 08, 2022

Copy link to clipboard

Copied

LATEST

Hi @M.Hasanain ,

one thing to note, though:

Recently I tried to change the composer by applying the string to the paragraph style itself through text.appliedParagraphStyle.composer = "Composer String". This surprisingly did not work. There was no error message, the applied paragraph style simply did not change.

 

What worked was to apply it to the text itself and then change the applied paragraph style accordingly through the GUI. I have to investigate this case…

 

Test done with my German InDesign 2022 on Windows 10 where I wanted to change the composer to the Japanese Single Line Composer.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines