Pages

2 juin 2008

Upper case first letter (2/8)

script upperCaseFirstLetter -- Majuscules 1ère lettre
property parent : myLowerCase
property string1 : "æœäåçéñöüàãõÿâêáëèíîïìóôòúûùabcdefghijklmnopqrstuvwxyz"
property string2 : "ÆŒÄÅÇÉÑÖÜÀÃÕŸÂÊÁËÈÍÎÏÌÓÔÒÚÛÙABCDEFGHIJKLMNOPQRSTUVWXYZ"
on myProcess(theText)
set theText to theText as text
set theText to continue myProcess(theText) -- script lowerCase
set firstChar to nFindReplace(first character of theText, string1, string2)
if the length of theText > 1 then
set theText to firstChar & characters 2 thru -1 of theText
else -- mot d'une lettre
set theText to firstChar
end if
return theText
end myProcess
end script

>>Ouvrir le script dans l'éditeur

Aucun commentaire: