set search_string to "on doit"
set falias to (path to desktop)
tell application "System Events"
set flist to (POSIX path of every file of falias whose file type is "osas")
end tell
set res to {}
set script_alias to missing value
repeat with f in flist
set qf to quoted form of f
set end of res to {(POSIX file f) as alias, (do shell script "/usr/bin/osadecompile " & qf)}
end repeat
repeat with pair in res
set script_alias to item 1 of pair
set script_text to item 2 of pair
if (script_text contains search_string) then
exit repeat
end if
end repeat
return script_alias
Philip Aker
Democracy: Two wolves and a sheep voting on lunch.