Regexp
Hi,
Yep, that would work if you're confident that you'll never get text like:
"Here foo:bar blah blah blah"
In which case, your script would get a false match of "oo:ba" which clearly isn't a time. If you were to use Satimage OSAX then you could use a regular expression such as:
Code:
set theText to "test of extracting the time 19:30 from all of 19 the other text"
set theFoundTimes to find text "[0-9]{2}:[0-9]{2}" in theText with all occurrences and regexp
Which would match any two digits, a colon then another two digits. You'd probably want to tweak the regular expression to avoid things like 1234:34567 (as an example) if there's a chance they might appear in your text. Writing clever regular expressions is not my strong point!
Hope that's some help,
Rob