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

Re: Aplescript for changing case


  • Subject: Re: Aplescript for changing case
  • From: Richard 23 <email@hidden>
  • Date: Mon, 8 Jan 2001 21:44:45 -0800

>I am new to this list, could someone please point me in the direction
>where I can find an applescript to change selected text from upper to
>lower case or vice versa please.
>I hope to learn a great deal from this list and perhaps one day write a
>script of my own!!!

You will and...you will!

You might find such a script cleverly concealed in this very email
message. While this one performs the to lowercase function it would
be pretty easy for you to modify it resulting in an uppercase version.

-- ---------------------------------------------------------
-- Preprocessed by Convert Script 1.0d2
-- ---------------------------------------------------------
ToLower("HEllO DoodS!")
--> "hello doods!"

property ABC : "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
property xyz : "abcdefghijklmnopqrstuvwxyz"

on ToLower(theStr)
set theStr to theStr as string
repeat with thePos from 1 to 26
if theStr contains (ABC's item thePos) then
set {AppleScript's text item delimiters} to ==>
{ABC's character thePos}
set {AppleScript's text item delimiters} to ==>
{xyz's character thePos, theStr's text items}
set {AppleScript's text item delimiters, theStr} to ==>
{"", result's end as string}
end if
end repeat
return theStr
end ToLower
-- ---------------------------------------------------------

You'll need to change the ==> to a continuation character (option-l
or option-return) which is also handled by Convert Script available
on my site.

R23


http://homepage.mac.com/richard23/


  • Prev by Date: Re: Web authoring tools
  • Next by Date: Re: Running two scripts at a time = problems (was: Re: if, idle, stay open - PROVE IT)
  • Previous by thread: Re: Aplescript for changing case
  • Next by thread: Re: Aplescript for changing case
  • Index(es):
    • Date
    • Thread