Re: Aplescript for changing case
Re: Aplescript for changing case
- Subject: Re: Aplescript for changing case
- From: email@hidden
- Date: Mon, 8 Jan 2001 20:44:24 EST
John Holt <email@hidden>writes:
>
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!!!
>
hi, heres a self generating script. run it then paste in another script.
in applescript ("a" = "A") = true
set v to "
\"UpPeR LoWeR\" returning text2change
set v to \"\"
repeat with i from 1 to count text2change by 1
set v to v & upper(item i of text2change)
end repeat
set y to \"\"
repeat with i from 1 to count text2change by 1
set y to y & lower(item i of text2change)
end repeat
{v, y}
to lower(x)
if x is \"a\" then
set x to \"a\"
"
repeat with i from 98 to 122 by 1
set v to v & "else if x is \"" & (ASCII character i) & "\" then
set x to \"" & (ASCII character i) & "\" " & return
end repeat
set v to v & " else
set x to x
end if
end upper
to upper(x)
if x is \"A\" then
set x to \"A\"
"
repeat with i from 66 to 90 by 1
set v to v & "else if x is \"" & (ASCII character i) & "\" then
set x to \"" & (ASCII character i) & "\" " & return
end repeat
set v to v & " else
set x to x
end if
end upper"
set the clipboard to v
cheers
John