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

Re: camelCase


  • Subject: Re: camelCase
  • From: Christopher Stone <email@hidden>
  • Date: Tue, 17 Jan 2012 02:39:52 -0600

On Jan 17, 2012, at 01:01, Shane Stanley wrote:
The point of having handlers in libraries, it seems to me, is to have code that just works, and doesn't need thinking about. Code that only works in English doesn't pass that test, IMO.
______________________________________________________________________

Agreed.

I also agree that after all these years Applescript should have native support for these kinds of conversions.

Somewhere out there is a vanilla handler written by Nigel Garvey (I think) that neatly handles accented characters, but I haven't had my hands on it for a while.

I still prefer the Satimage.osax - one of the many reasons I think it indispensable.  (Please forgive the incorrect usage of accented characters in the example.)

set ex to "ţhe ƿeople ŏf ńeuchâtel might not be ĭmpressed"
set titleCase to change "\\b(.)(.*?)\\b" into "\\u\\1\\l\\2" in ex with regexp

--> Ţhe Ƿeople Ŏf Ńeuchâtel Might Not Be Ĭmpressed

set ex to "ŢHE ǷEOPLE ŎF ŃEUCHÂTEL MIGHT NOT BE ĬMPRESSED"
set titleCase to change "\\b(.)(.*?)\\b" into "\\u\\1\\l\\2" in ex with regexp

--> Ţhe Ƿeople Ŏf Ńeuchâtel Might Not Be Ĭmpressed

set camelCase to change "\\b(.)(.*?)\\b *" into "\\u\\1\\l\\2" in ex with regexp
set camelCase to change "^(.)" into "\\l\\1" in camelCase with regexp

--> ţheǷeopleŎfŃeuchâtelMightNotBeĬmpressed

--
Best Regards,
Chris

 _______________________________________________
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

References: 
 >ScriptingAddition for camelcase (From: Ronald Hofmann <email@hidden>)
 >Re: ScriptingAddition for camelcase (From: BareFeetWare <email@hidden>)
 >Re: ScriptingAddition for camelcase (solved via PHP) (From: Ronald Hofmann <email@hidden>)
 >Re: ScriptingAddition for camelcase (solved via PHP) (From: Shane Stanley <email@hidden>)
 >camelCase (From: BareFeetWare <email@hidden>)
 >Re: camelCase (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: camelCase
  • Next by Date: Re: ScriptingAddition for camelcase
  • Previous by thread: Re: camelCase
  • Next by thread: Re: ScriptingAddition for camelcase
  • Index(es):
    • Date
    • Thread