Skip to main content
Participant
May 20, 2008
Question

Indesign CS2. How to find "all caps" format text and change it to real uppercase?

  • May 20, 2008
  • 6 replies
  • 744 views
Indesign CS2. How to find "all caps" format text and change it to real uppercase?<br /><br />Juan Cordova - 07:19pm May 20, 2008 Pacific<br /><br />I need to find all the text strings with all caps local formatting in an InDesign CS2 document, in order to replace it with real uppercase or insert a pseudo-xml tag before and after each string (something like <UC> before and <\UC> after.) <br /><br />I'm sure this is possible in a script but my limited experience doesn't help me. <br /><br />Can anyone help me please. <br /><br />I'll really appreciate that<br /><br />Juan Cordova
This topic has been closed for replies.

6 replies

Known Participant
July 28, 2008
Hi Martin,

Thanks for the above code. It really works in CS3!!!!

Regards,
Hemi
Participant
July 25, 2008
Hi Martin,

I unable to convert you script from CS2 to CS3 to change the upper case into real value, it's showing error in 'changecase' line.

Pl. help.

Thanks,

G. Raja
Participant
May 22, 2008
Ok Martin

I've found the anwser

Thank you for the advice

Juan
Inspiring
May 22, 2008
Juan,<br /><br />> How can I do remove these pseudo tags inserted before? <br /><br />By search & replace. ;-)<br /><br />Or remove these lines:<br /><pre><br />myText.insertionPoints[-1].contents = '<\\UC>'; <br />myText.insertionPoints[0].contents = '<UC>'; <br /></pre><br /><br />Martin
Participant
May 22, 2008
Thank you very much Martin

and sorry for the next question:

How can I do remove these pseudo tags inserted before?

My intention is leaving the document without this pseudo tags.

Juan
Inspiring
May 21, 2008
Hi Juan,

this could be done like this:


app.findPreferences = app.changePreferences = null;
var myResult = app.activeDocument.search( '', false, false, undefined, {capitalization:Capitalization.allCaps })
for ( i = myResult.length-1; i >= 0 ; i-- )
makeUpperCase( myResult );

function makeUpperCase ( myText )
{
try // footnotes may disturb the job in InDesign CS2
{
myText.capitalization = Capitalization.normal;
myText.changecase( ChangecaseMode.uppercase );
myText.insertionPoints[-1].contents = '<\\UC>';
myText.insertionPoints[0].contents = '<UC>';
}
catch(e) {}
}


Martin