is there a way to get notified when terminal finished a command?
-> I run another script(not mine!) which downloads data when this script finished I want to quit terminal and do other stuff with this data.
EDIT:
I may didnt 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 you! Working like that:
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
terminal-notifier is a command-line tool to send macOS User Notifications, which are available on macOS 10.10 and higher.
in the upper-right corner of your screen, or swipe left with two fingers from the right edge of your trackpad. To view notifications that you missed, such as calendar alerts or FaceTime calls, click Notifications at the top of Notification Center. To open a notification in the app that sent it, click the notification.
Give Notification Permission Step 2: Open System Preferences menu. Step 3: Go to the Notifications & Focus menu. Step 4: Select an app that's giving you trouble with notifications. Enable Allow Notifications toggle and close the menu.
Open Command Prompt in WindowsClick Start and search for "Command Prompt." Alternatively, you can also access the command prompt by pressing Ctrl + r on your keyboard, type "cmd" and then click OK.
Terminal's Dock icon starts bouncing when a tab prints \a and the tab is not focused or Terminal is not frontmost:
sleep 5; printf '\a'
You could also run something like afplay /System/Library/Sounds/Blow.aiff
. Or use terminal-notifier:
sudo gem install terminal-notifier
terminal-notifier -message ''
You can wait until a program finishes running by checking the busy property of a tab:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With