• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Text - change case
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Text - change case
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Text - change case (From: "Ruby Madraswala" <email@hidden>)

  • Prev by Date: Re: Need way to set the Creation date of a file via OSX
  • Next by Date: Re: Clear Metadata in Tiger
  • Previous by thread: Re: Text - change case
  • Next by thread: Re: Text - change case
  • Index(es):
    • Date
    • Thread