Re: Text - change case
Re: Text - change case
- Subject: Re: Text - change case
- From: Kim Hunter <email@hidden>
- Date: Fri, 20 May 2005 00:39:30 +1000
Title: Re: Text - change case
Damm I just wrote basically the same things "Bastiaan Boertien" but with a lot less code
Sorry I didn’t read what you ment proply in the initial post
set thisString to "Im AN IDIOT I SHOULD READ THE WHOLE POST FIRST"
CapitalizeFirstLetter_ofEveryWord(thisString)
on CapitalizeFirstLetter_ofEveryWord(InputString)
set TheString to do shell script "echo " & InputString & " | tr '[A-Z]' '[a-z]'"
set wordsofTheString to words of TheString as list
set TotalCount to count of wordsofTheString
set theCount to 1
repeat until theCount is greater than TotalCount
set theWord to item theCount of wordsofTheString
set theChars to characters of theWord as list
set Capital to item 1 of theChars
set item 1 of theChars to do shell script "echo " & Capital & " | tr '[a-z]' '[A-Z]'"
if theCount is less than TotalCount then
set theWord to (theChars as string) & " "
else
set theWord to (theChars as string)
end if
set item theCount of wordsofTheString to theWord
set theCount to theCount + 1
end repeat
set TheString to wordsofTheString as string
return TheString
end CapitalizeFirstLetter_ofEveryWord
On 19/5/05 11:00 PM, "Ruby Madraswala" <email@hidden> wrote:
Hi All.
It’s always the simple/basic that stumps me. I checked the web and books found no examples. I did find examples of changing to upper case or lower case, but not what I want.
Write counter & “ “ & item x of wordlist & return to outfile
Item x of wordlist is in upper case: ex. APPLE COMPUTER and I want to write this as Apple Computer. Item x of wordlist can be one word or up to 5 words.
OS 10.3.9
Ruby
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden