#Word Counter
on findLr(the_string, charTF)
set AppleScript's text item delimiters to charTF --use of the searched string to separate bits
set the_list to text items of the_string --put those bits in a list
set charNbr to ((count of the_list) - 1) --count those bits, minus 1
set AppleScript's text item delimiters to ""
return charNbr
end findLr
This is working fine, but I'm wondering if there's a better or a more efficient way to do the same. Maybe with grep or ASObjC Runner or with a built-in command in TextWrangler.
The file has thousands of lines and it's generated dynamically so the performances are critical.