Setting language independent style property

Guest
Feb 01, 2021 Feb 01, 2021

Copy link to clipboard

Copied

I do create a custom style, but it worked only on english version on Indesign. On polish it didnt work, so I wrote this code to handle two languages.

try{
myCharacterStyle.strikeThroughType = 'Jednolity';
}catch (MyError){
myCharacterStyle.strikeThroughType = 'Solid';
}

but I would like to know if there is other nicer and language independent way.

I searched jongware reference but couldnt find working solution. There is a StrokeStyle class but doesnt work.

TOPICS
Scripting

Views

78

Likes

translate

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 1 Correct Answer

Adobe Community Professional , Feb 01, 2021 Feb 01, 2021
Try the following, this should work on every language version   myCharacterStyle.strikeThroughType = '$ID/Solid' To find the language-independent string you can use the findKeyStrings method on the application object. For ex:- app.findKeyStrings('Solid')   -Manan

Likes

translate

Translate

Translate
Adobe Community Professional ,
Feb 01, 2021 Feb 01, 2021

Copy link to clipboard

Copied

Witamy! What are you trying to get this character style to do?

Mike Witherell

Likes

translate

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
Guest
Feb 01, 2021 Feb 01, 2021

Copy link to clipboard

Copied

assign this style to object (found text)

 

 

obj.appliedCharacterStyle='my-style'

 

Likes

translate

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 ,
Feb 01, 2021 Feb 01, 2021

Copy link to clipboard

Copied

Try the following, this should work on every language version

 

myCharacterStyle.strikeThroughType = '$ID/Solid'

To find the language-independent string you can use the findKeyStrings method on the application object. For ex:-

app.findKeyStrings('Solid')

 

-Manan

Likes

translate

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
Guest
Feb 01, 2021 Feb 01, 2021

Copy link to clipboard

Copied

That's right. It is in JS Guide in Localization section 

Likes

translate

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