Hi,
I want to build a routine to search all paragraphs for a specific string (lets say ‘Vanilla ice’, with a recurrence of 100 entries)
;D
the problem is I have a lot of large txt-documents and want another approach. My current script sucks to much.
set Mytext to choose file with prompt "find your txt-file" without invisibles
set the_txt to text returned of (display dialog "Enter search-term" default answer žbeer")
set the_f to read file Mytext as text
if the_txt is in the_f then my control_file(the_f, the_ls ,
the_txt)
on control_file(the_f, the_ls, the_txt)
repeat with i from 1 to count of paragraphs in the_f
if the_txt is in (paragraph i of the_f) then copy (paragraph i of the_f) to end of the_ls -- the_info
end repeat
end control_file
if the_ls is not {} then set txt to (choose from list the_ls)