-
1. Re: Change lowercase to Title Case
pkahrel Jan 10, 2013 11:07 AM (in response to GeofferyH)app.findGrepPreferences = null; app.findGrepPreferences.findWhat = /\u\l+?-\l/.source; names = app.activeDocument.findGrep(); for (i = names.length-1; i > -1; i--) names[i].contents = names[i].contents.replace (/(.)$/, function () {return arguments[1].toUpperCase()});Peter
-
2. Re: Change lowercase to Title Case
cdflash Jan 12, 2013 1:21 AM (in response to GeofferyH)Pete's script is handy if the file has been merged to a new indesign file.
There is a way to change the case before the merge using GREP styles, saving the step of merging to an indesign file and can merge directly to a PDF (assuming the file is going to be imposed from a PDF). Full credit should go to Jongware for revealing this to me a while ago.
The full write-up is at http://colecandoo.wordpress.com/2012/08/08/no-fills-grep-styles-part-1/ but the bit that the OP is interested in is here.
In the paragraph style that contains the hyphenated names, two character styles need to be made first: one called notuppper, and one called upper. the "notupper" character style effectively has nothing applied EXCEPT in basic character formats, the case is set to NORMAL. in "upper", nothing is applied EXCEPT in basic character formats, the case is set to ALL CAPS.
The paragraph style will refer to these character styles via GREP styles. two grep styles are made and must appear in this order:
top grep: apply upper.
to text: \b\u\l+\-\l
bottom grep: apply notuppper
to text: \b\u\l+-(?=\l)
If this doesn't make sense, read my complete post on my blog and download the sample if need be.
colly


