Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
iTerm2 has triggers that do this: – user588 Jul 21 '12 at 0:22
up vote 2 down vote accepted
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
share|improve this answer
Thnx! Do you know how I can run this script for each of my terminal tabs? – chchrist Jul 31 '12 at 9:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.