capitalising words in titles.
Code in the button "SORT THINGS OUT":
Code: Select all
on mouseUp
put empty into fld "fCOOKED"
put fld "fRAW" into cRAW
put 1 into KOUNT
repeat until cRAW is empty
put word 1 of cRAW into rWORD
put 1 into QOUNT
repeat until line QOUNT of fld "fRW" is empty
put line QOUNT of fld "fRW" into VOX
if rWORD = VOX then
put rWORD & numToCodePoint(32) after fld "fCOOKED"
delete word 1 of cRAW
put 33 into xPASS
end if
add 1 to QOUNT
end repeat
if xPASS = 33 then
-- do nothing
else
put toUpper (char 1 of rWORD) into cC
delete char 1 of rWORD
put (cC & rWORD) into cWORD
delete word 1 of cRAW
put cWORD & numToCodePoint(32) after fld "fCOOKED"
end if
add 1 to KOUNT
put KOUNT
put 0 into xPASS
end repeat
end mouseUp