• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

FindChangeByList - Code for Applying Character Style

New Here ,
Apr 26, 2017 Apr 26, 2017

Copy link to clipboard

Copied

I want to find any English character (upper & lower case) and apply a certain existing character style.
In the list - I have wrote:

grep{findwhat:"\u|\l"}{changeTo:"", applycstyle: EnglishTosefet}

"EnglishTosefet" is of-course the name of the character style.

The error massage seems to refer to the name of the character style as if it is wrong, but this is an existing character style and its name is written correctly.
Is the code written correctly?

TOPICS
Scripting

Views

589

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
Guide ,
Apr 26, 2017 Apr 26, 2017

Copy link to clipboard

Copied

Make sure your character style are not in STYLE GROUP..

Just post your character style panel screenshot

Votes

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
New Here ,
Apr 26, 2017 Apr 26, 2017

Copy link to clipboard

Copied

Hi. As can seen - the character style is not part of a group

Untitled.jpg

Votes

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
Guide ,
Apr 26, 2017 Apr 26, 2017

Copy link to clipboard

Copied

use appliedCharacterStyle method..

I hope you are using FindChangeList.txt what we are getting from Indesign inbuild

grep{findwhat:"\u|\l"}{changeTo:"$0"} {appliedCharacterStyle: "EnglishTosefet"}

Votes

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
Guide ,
Apr 26, 2017 Apr 26, 2017

Copy link to clipboard

Copied

Try this also

grep{findwhat:"\u|\l"}{changeTo:"$0", appliedCharacterStyle: "EnglishTosefet"}    {}

Votes

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
New Here ,
Apr 26, 2017 Apr 26, 2017

Copy link to clipboard

Copied

Hello. some progress, but not really...: I do not receive an error massage, but nothing in the document changes.

Votes

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
Guide ,
Apr 26, 2017 Apr 26, 2017

Copy link to clipboard

Copied

It is easy to run the script as jsx format.. not sure why you still using FindChangeList.txt !!!

Try this code.. it dont need FindChangeList.txt

app.findGrepPreferences = null;    app.changeGrepPreferences = null;

app.findGrepPreferences.findWhat="\\u|\\l";

app.changeGrepPreferences.appliedCharacterStyle  = "EnglishTosefet";

app.changeGrep();

Votes

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
New Here ,
Apr 27, 2017 Apr 27, 2017

Copy link to clipboard

Copied

LATEST

Hi. Thanks for your concern, but I DO NOT HAVE PROBLEM doing this as a separate action. I am using this find\replace for a long time as a separate action (see pic attached of the xml that indesign makes when you save a find\replace action). The problem occured when I tried to insert this to the list.

Untitled2.jpg

Votes

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