Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Display Notification Center Alerts from command line and AppleScripts' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Display Notification Center Alerts from command line and AppleScripts
Authored by: tfoutz99 on Sep 04, '12 10:39:17AM
You can then make a simple bash interface (e.g. ~/bin/Notify.sh):
#!/bin/bash
automator -D title="$1" -D subtitle="$2" -D message="$3" ~/Library/Workflows/"Display Notification.workflow" > /dev/null 2>&1

make it executable (e.g. chmod u+x ~/bin/Notify.sh), and then use:
Notify.sh title subtitle message
This makes an easy replacement for growlnotify scripts. Thanks!

[ Reply to This | # ]
Display Notification Center Alerts from command line and AppleScripts
Authored by: anakin on Feb 22, '13 09:15:37AM
You can also add this as a function to your .bashrc file. The nice part about this is if you just want to fire a quick message without a title or a subtitle, you can.
function notify {
  if [ -z $1 ]; then
     echo "Usage: notify   "
     echo "Usage: notify  "
     echo "Usage: notify "
  elif [ -z $2 ]; then
     automator -D message="$1" ~/Documents/Notify.workflow > /dev/null 2>&1
  elif [ -z $3 ]; then
     automator -D title="$1" -D message="$2" ~/Documents/Notify.workflow > /dev/null 2>&1
  else
     automator -D title="$1" -D subtitle="$2" -D message="$3" ~/Documents/Notify.workflow > /dev/null 2>&1
  fi
}


[ Reply to This | # ]