Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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: iterm2.com/triggers.html#/section/home –  user588 Jul 21 '12 at 0:22
add comment

1 Answer 1

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
        else
            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
add comment

Your Answer

 
discard

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.