Re: Text - change case
Re: Text - change case
- Subject: Re: Text - change case
- From: Steve Hayman <email@hidden>
- Date: Thu, 19 May 2005 11:22:58 -0400
Perl can be handy here if you can get past all the escape and
backslash quoting issues. It has a couple of operators that can
uppercase and lowercase strings - and a \u that says "uppercase one
character only."
So here is a possibility. Pipe the text through a little perl script
that says, "for each word, convert the first character to upper case
and the rest to lower case."
set str to "APPLE COMPUTER"
-- I freely admit I did not get this right on the first try.
do shell script "echo " & quoted form of str & " |perl -p -e 's/(\\w
+)/\\u\\L$1/g;'"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden