I currently have an AppleScript app that opens Terminal windows and completes commands. I would like an app icon badge to appear on the Terminal icon in the Dock when a command completes. I need this because I often have to restart the commands when they stop. Is this possible? Essentially my AppleScript application takes a user-provided variable and plugs it into a Terminal command. Every time I use the application it opens a new Terminal window (intended). I would like to have a badge appear when a Terminal command completes.
Ny way to have a badge appear on the Terminal icon in the Dock when a command completes
notificationsterminal
Related Question
- MacOS – Set a custom dock icon for an application instance via Terminal
- MacOS – OS X terminal “open” command and keeping focus on the command line
- Mac – Remove Mac App Store notification badge from the Dock
- MacOS – Why is the System Preferences Dock icon showing a Badge
- MacOS – How to create an apple script that toggles between opening and closing an application
- Why does the curl command fail when run through applescript but work fine when I run directly in a terminal
Best Answer
As of Mac OS X 10.7 Lion, Terminal has exactly this feature.
If you emit a bell (BEL, Control-G) in a background tab or window, the Terminal application Dock icon will show a badge with the number of “unread” bells
and a bell icon is displayed in the tab of the terminal
(If there is only one tab in the window, choose View > Show Tab Bar to see the tab, which also displays other status information.)
This also applies to minimized windows.
When you bring the window to the front or select the background tab, the bell indicator is removed from the tab and the badge count goes down.