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

find uppercase - change in lower

Guide ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Hello to all,

i have bibliography which contains lot of names in uppercase.

Is there a script or grep to find all these words and change them in lowercase living only first letter in uppercase?

e.g.: MARC TWAIN > Marc Twain; G. ORSON WELLES > G. Orson Welles

I can find uppercase with grep "\u+" but I can't change them in lower case.

Thank you in advance

TOPICS
Scripting

Views

1.2K

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

Enthusiast , Jul 23, 2014 Jul 23, 2014

Try this,

   app.findGrepPreferences = app.changeGrepPreferences = null;

    app.findGrepPreferences.findWhat = "\\u+";

    finds = app.selection[0].findGrep();

    for(var i=0;i<finds.length;i++){

        finds.texts[0].changecase(ChangecaseMode.titlecase);

    }

    app.findGrepPreferences = app.changeGrepPreferences = null;

Votes

Translate

Translate
Contributor ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

HI,

Take a look of this link:

Script to replace small caps that are typed as capital letters with non-capital letters (A =&gt; a, ...

the script made by Chinna

may be you can find what you want

John

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
Contributor ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

if the script is what you want

can you give Chinna a correct,

don't give me, please

john

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 ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

hello Johnwhite,

thank you for your answer.

I wrote a word in uppercase, in one new document, and I tried the script but nothing happens (i have indesign cs6, mac os x 10.6.8).

Probably I do something wrong

Thank you anyway

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
Enthusiast ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Please update your word in the array list, it will do the rest.

var array = ["MARC TWAIN", "ORSON WELLES"];//update your word here


Vandy

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 ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Hi vandy88,

I think I would lose a lot of time to put all the names in the script.

This is not a list of names but bibliography.

Thank you a lot anyway

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
Enthusiast ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Hope this will help you...

var array = ["MARC TWAIN", "ORSON WELLES"];

for(var j=0; j<array.length; j++)

{

    app.findGrepPreferences = app.changeGrepPreferences = null;

    app.findGrepPreferences.findWhat = array;

    finds = app.documents[0].findGrep();

    for(var i=0;i<finds.length;i++){

        finds.texts[0].changecase(ChangecaseMode.titlecase);

    }

    app.findGrepPreferences = app.changeGrepPreferences = null;

}

Vandy

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 ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Hello vandy88,

the names I wrote before (MARC TWAIN, ORSON WELLES) was only example.

In my document there are a hundreds different names that I should change to lower case

Thank you

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
Enthusiast ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Try this,

   app.findGrepPreferences = app.changeGrepPreferences = null;

    app.findGrepPreferences.findWhat = "\\u+";

    finds = app.documents[0].findGrep();

    for(var i=0;i<finds.length;i++){

        finds.texts[0].changecase(ChangecaseMode.titlecase);

    }

    app.findGrepPreferences = app.changeGrepPreferences = null;

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 ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Hi vandy88,

now your script is very good!

Could you make it work for just the selected text?

Thank you a lot

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
Enthusiast ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Try this,

   app.findGrepPreferences = app.changeGrepPreferences = null;

    app.findGrepPreferences.findWhat = "\\u+";

    finds = app.selection[0].findGrep();

    for(var i=0;i<finds.length;i++){

        finds.texts[0].changecase(ChangecaseMode.titlecase);

    }

    app.findGrepPreferences = app.changeGrepPreferences = null;

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
Enthusiast ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Hi premio_oscar,

script is working or not ?

if yes, mark as correct answer...

Vandy

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 ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Hello vandy88

forgive me, I could not see before your answer.

Now I tried the script and it's great.

Thank you a lot!

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 ,
Nov 29, 2020 Nov 29, 2020

Copy link to clipboard

Copied

how do I use that script you have sent @Johnwhite ? 

I need find uppercase and replace to lowercase.. 

Indesign CC

 

Many thanks!

Kind Regards

Karel

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
Community Expert ,
Nov 29, 2020 Nov 29, 2020

Copy link to clipboard

Copied

LATEST

Hi Karel,

the link in the reply of Johnwhite is not working anymore. Initially it linked to a thread in the old InDesign or InDesign Scripting Forum. Unfortunately that thread was not moved to this forum last year when the forum software switched from Jive to Khoros.

 

Instead you may look into this script by Peter Kahrel:

 

Change case

InDesign's GREP is powerful, but one feature it lacks is case conversion: you can't change the case of what your GREP expression matches. But this can be remedied by a script that acts as a kind of extension to the Find/Change dialog. …

https://creativepro.com/files/kahrel/indesign/grep_change_case.html

 

Regards,
Uwe Laubender

( ACP )

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