• 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: Aplescript for changing case (again)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Aplescript for changing case (again)


  • Subject: Re: Aplescript for changing case (again)
  • From: cris <email@hidden>
  • Date: Wed, 10 Jan 2001 03:37:50 +0100

on 09.01.2001 22:54 Uhr, Arthur J Knapp at email@hidden wrote:

> Yeah. The "Essential Routines" module from Apple is nice, and
> very clearly written, but Richard 23's implementation contains
> all the current *best thinking* on vanilla case conversion.
Indeed, very nice thing! I changed it a bit so we can now choose to lower
or to uppercase the text. I removed also the properties, making it more
independent. I hope Richard 23 will not hang me.


ChangeCase("HEllO DoodS!", false)
--> "hello doods!"

on ChangeCase(theString, UpperCaseF)
if UpperCaseF then
set {ABC, xyz} to {"abcdefghijklmnopqrstuvwxyz",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"}
else
set {xyz, ABC} to {"abcdefghijklmnopqrstuvwxyz",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"}
end if
--
tell (a reference to AppleScript's text item delimiters)
set contents to ""
set theString to theString as string
repeat with thePosition from 1 to 26
if theString contains (ABC's item thePosition) then
set {contents} to {ABC's item thePosition}
set {contents} to {xyz's item thePosition, theString's text items}
set theString to result's end as string
end if
end repeat
set {contents} to {""}
return theString
end tell
end ChangeCase



Greetings
cris


References: 
 >Re: Aplescript for changing case (again) (From: "Arthur J Knapp" <email@hidden>)

  • Prev by Date: Re: Parent Property And Facespan
  • Next by Date: Re: And now...
  • Previous by thread: Re: Aplescript for changing case (again)
  • Next by thread: Re: Aplescript for changing case (again)
  • Index(es):
    • Date
    • Thread