Ask a Question related to Adobe Indesign Windows, Design and Development.
-
Ken_Grace@adobeforums.com #1
Automatic case changing
Does anyone know a way (have a script) for changing case according to
character or paragraph style?
I am importing a lot of text with headings in caps, and want to be able to
change them to sentance case.
k
Ken_Grace@adobeforums.com Guest
-
Changing text without changing frames.
I have a small flash movie that is basically a color chooser. Rather than changing the color of an item by putting the color in a frame I change... -
case and functions
Yo..... I read in Learning Perl that there are no such constructs like a case statement. Is there something similar or did I misread this? Also... -
#23026 [Com]: Make Zend case-sensitive (classes, functions, remove case-insensitive)
ID: 23026 Comment by: nvivo at mandic dot com dot br Reported By: mfischer@php.net Status: Open Bug Type: ... -
Changing case of the first letter of words in string
I want to make the case of the first letter of all the words in a selected string to upper case. The code s/\b(\w+)/\u$1\E/g; enables me to do... -
Case Sensitive
I did the following: 1. create table amit (name varchar(10) not null Primary key) 2. insert into amit values ('a') 3. select * from amit 4.... -
Dave_Saunders@adobeforums.com #2
Re: Automatic case changing
Here you go:
if (app.documents.length != 0) {
myDoc = app.activeDocument;
myStyles = ["Head","Subhead"];
app.findPreferences = null;
app.changePreferences = null;
for (i=0; myStyles.length>i; i++) {
try {
myStyle = myDoc.paragraphStyles.item(myStyles[i]);
myStyle.name;
}catch(e){
// Ignore missing styles
continue;
}
myFinds = myDoc.search("",false,false,undefined,{appliedPara graphStyle:myStyle});
for (j=0; myFinds.length>j; j++) {
myFinds[j].changecase(ChangecaseMode.sentencecase);
}
}
}
Just replace or add style names to the third line. The script ignores any style names that are not present in the document.
Dave
Dave_Saunders@adobeforums.com Guest
-
Ken_Grace@adobeforums.com #3
Re: Automatic case changing
Brilliant. Thanks Dave. I'll remember this script (!).
k
Ken_Grace@adobeforums.com Guest
-
Dave_Saunders@adobeforums.com #4
Re: Automatic case changing
I guess I should take some steps to make sure I do. I just banged it out so at the moment this is the only place it exists.
Dave
Dave_Saunders@adobeforums.com Guest
-
Ken_Grace@adobeforums.com #5
Re: Automatic case changing
I would think it quite useful in a wider context, like on Exchange. What
would make it really user friendly would be to add an input box with a drop
down of paragraph/character styles in the document, story/document/selection
wide selection and the change case options.
What, of course, would ultimately be neater would be if Adobe were to put
change case options in find/replace.
Thanks again Dave, that's going to save me a lot of time.
k
Ken_Grace@adobeforums.com Guest
-
Dave_Saunders@adobeforums.com #6
Re: Automatic case changing
And then there's the concepts of "smart" sentence case and "smart" title case where selected words can be listed for exceptional treatment (remain all-caps in the first case; go to all lowercase in the second).
Perhaps, rather than a dialog box, if the script took instructions from an editable text file. I don't like dialog boxes if I can help them, but I also don't like having to tell people to edit scripts in order to use them.
Not that I have anything against the Exchange, but I'm assembling a page of useful utitlities on my web site. I'll work up a more useful version of this script and add it. The page is here: Informal Utilities for Download <http://pdsassoc.com/index.php?Nav=downssub&Ban=InformalUtilitiesForDow nload&Info=downloads/index.php>.
Dave
Dave_Saunders@adobeforums.com Guest
-
mikewitherell_at_jetsetcom_dot_net #7
Re: Automatic case changing
Dave,
Is that saved as a .js javascript textfile?
Thanks,
Mike Witherell in Washington DC
mikewitherell_at_jetsetcom_dot_net Guest
-
Dave_Saunders@adobeforums.com #8
Re: Automatic case changing
Mike,
Yes.
Help me brainstorm. How about a text file that looks like this:
Paragraph Styles
name1
name2
Character Styles
name1
name2
Internal Caps
InDesign
PageMaker
McDonald's
Lowercase Exceptions
and
by
with
for
etc.
Uppercase Exceptions
BBC
IBM
etc.
This file would sit in the same folder as the smart case changer -- except I'm inclined to think I need two script: smart Title case and smart Sentence case.
Each script would work like this:
If you have a text selection then the script ignores the style names and does its thing on the selection, applying the other lists as appropriate.
If you have no names listed under the styles, then it will complain if there is no selection. But if you have names there and no text selection, it will apply its changes to the designated styles, if they are used in your document.
What if you have a text frame selected? How about a single insertion point?
For the former, I could apply the style changes to only the text frame (or to its parent story). For the later, the style changes could be applied to the parent story.
Perhaps in this odd-ball cases, the script should check with the user before doing anything or there could even be a check with user directive in the text file.
What do you think?
Dave
Dave_Saunders@adobeforums.com Guest



Reply With Quote

