Notification when the terminal is ready / ready - Applescript

Is there a way to get notified when the terminal has finished the command?

-> I run another script (not mine!) That loads the data, when this script is finished, I want to exit the terminal and do other things with this data.

EDIT:
I could not ask correctly ...

Example:


tell application "Terminal"
   keystroke "php downloadscript.php"
   keystroke return
end tell

if (downloadFinished) -- do stuff else -- wait till finished

Edit 2: Awesome! Thank! By working like this:


tell application "Terminal"
    set frontWindow to window 1
    repeat until busy of frontWindow is false
        delay 1
    end repeat
    #display dialog "finished"
end tell
greetings hatschii
+5
source share
1 answer

The terminal dock icon starts to bounce when the tab prints \ a and the tab is not focused or the terminal is not in front:

sleep 5; printf '\a'

You can also run something like afplay /System/Library/Sounds/Blow.aiff. Or use a notifying terminal:

sudo gem install terminal-notifier
terminal-notifier -message ''

, , busy :

tell application "Terminal"
    set w to do script "sleep 5"
    repeat
        delay 1
        if not busy of w then exit repeat
    end repeat
end tell
+6

All Articles