capString("Frédéric Fromentin")
on capString(aString)
set theString to current application's NSString's stringWithString:aString
return (theString's uppercaseString()) as text
end capString
There's new stuff for them here, and the understandable first reaction will probably be something along the lines of, "Do I really need something else to think about?"
But consider a newcomer, and these two bits of code:
on replaceText(theString, theFind, theReplace)
considering case
set saveTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to {theFind}
set theBits to text items of theString
set AppleScript's text item delimiters to {theReplace}
set theString to theBits as string
set AppleScript's text item delimiters to saveTID
end considering
return theString
end replaceText
And:
on replaceText(theString, theFind, theReplace)
set theNSString to current application's NSString's stringWithString:theString
set theNSString to theNSString's stringByReplacingOccurrencesOfString:theFind withString:theReplace
return theNSString as text
end replaceText