Re: Re. third-party dependencies [was Re: Stock Quotes using AppleScript]
Re: Re. third-party dependencies [was Re: Stock Quotes using AppleScript]
- Subject: Re: Re. third-party dependencies [was Re: Stock Quotes using AppleScript]
- From: KOENIG Yvan <email@hidden>
- Date: Mon, 16 Mar 2009 19:09:36 +0100
Here is an enhanced version:
<script>
on upper_case(theString) --> string
local newString
local lowRoman, upRoman, c, a, i (* added *)
set lowRoman to "œæáàâäãåéèêëóòôöõúùûüíìîïñçøÿπ"
set upRoman to "ŒÆÁÀÂ�ÄÃÅÉÈÊËÓÒÔÖÕÚÙÛÜÍÌÎÏÑÇØŸ∏"
set newString to ""
repeat with c in characters of theString
set c to contents of c
set a to ASCII number of c
if a > 96 and a < 123 then
set a to a - 32
set newString to newString & (ASCII character a)
else if c is in lowRoman then
set newString to newString & character (offset of c in lowRoman)
of upRoman
else
set newString to newString & c
end if
end repeat
set theString to newString
end upper_case
on lower_case(theString) --> string
local newString (* added *)
local lowRoman, upRoman, c, a, i (* added *)
set lowRoman to "œæáàâäãåéèêëóòôöõúùûüíìîïñçøÿπ"
set upRoman to "ŒÆÁÀÂ�ÄÃÅÉÈÊËÓÒÔÖÕÚÙÛÜÍÌÎÏÑÇØŸ∏"
set newString to ""
repeat with c in characters of theString
set c to contents of c
set a to ASCII number of c
if a > 64 and a < 91 then
set a to a + 32
set newString to newString & (ASCII character a)
else if c is in upRoman then
set newString to newString & character (offset of c in upRoman) of
lowRoman
else
set newString to newString & c
end if
end repeat
set theString to newString
end lower_case
return {my upper_case("Kœnig"), my lower_case("GÉNÉRAL KŒNIG")}
<script>
Yvan KOENIG (from FRANCE lundi 16 mars 2009 19:07:12)
_______________________________________________
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