• 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: Init Caps Handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Init Caps Handler


  • Subject: Re: Init Caps Handler
  • From: Skeeve <email@hidden>
  • Date: Tue, 20 Nov 2007 22:25:50 +0100

Oakley Masten wrote:
Instead of trying to reinvent the wheel: I thought I
would ask first.

Is there an existing handler that takes a text
variable and reconfigures it to "Initial Capitals" for
every word?

While I'm at it how about "All Caps" and "No Caps"?
Not existing but an easy one:

on InitialCaps for a_text
   do shell script "perl <<-'" & (ASCII character 3) & "'
       while (<DATA>) {
           print(ucfirst $_) foreach split /\\b/;
       }
       __DATA__" & (ASCII character 10) & a_text
end InitialCaps

on AllCaps for a_text
   do shell script "perl <<-'" & (ASCII character 3) & "'
       while (<DATA>) {
           print uc $_;
       }
       __DATA__" & (ASCII character 10) & a_text
end AllCaps

on NoCaps for a_text
   do shell script "perl <<-'" & (ASCII character 3) & "'
       while (<DATA>) {
           print lc $_;
       }
       __DATA__" & (ASCII character 10) & a_text
end NoCaps

NB: Requires perl and there is no ASCII Character 3 allowed in the text...

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Init Caps Handler
      • From: Skeeve <email@hidden>
References: 
 >Init Caps Handler (From: Oakley Masten <email@hidden>)

  • Prev by Date: Re: Photoshop CS3 conversions
  • Next by Date: Re: Applescript schedulers
  • Previous by thread: Init Caps Handler
  • Next by thread: Re: Init Caps Handler
  • Index(es):
    • Date
    • Thread