I want to be able to check if a word appears in a terminal window running a java application and then display a notification. Any ideas?


1 Answer 1

tell application "Terminal"
    repeat 120 times -- ~ 2 minutes
        if contents of front window contains "word" then
            say "match"
            -- insert your code here
            exit repeat
            delay 1
        end if
    end repeat
end tell
  • Thnx! Do you know how I can run this script for each of my terminal tabs?
    – chchrist
    Jul 31, 2012 at 9:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .