emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] MacOSX: Notifications with Growl


From: Rick Moynihan
Subject: Re: [Orgmode] MacOSX: Notifications with Growl
Date: Fri, 07 Nov 2008 11:25:54 +0000
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

Alex Ott wrote:
Hi all

I wrote small note about show notifications with Growl under Mac OS X.
This could be useful when using org-mode.  Note is could be found on my site
http://xtalk.msk.su/~ott/en/writings/EmacsMacOSXAndGrowl.html

Thanks for this, this'll prove handy at work. I took the liberty of simplifying the elisp a little. This version doesn't create a temporary file, and instead uses a shell HEREDOC.

(defun output-to-growl (msg)
    (shell-command (format "osascript <<ENDSCRIPT
tell application \"GrowlHelperApp\"
     notify with name \"Emacs Notification\" title \"Emacs alert\" \
       description «data utxt%s» as Unicode text \
       application name \"Emacs\"
   end tell
ENDSCRIPT"  (osd-text-to-utf-16-hex msg))))

(defun osd-text-to-utf-16-hex (text)
  (let* ((utext (encode-coding-string text 'utf-16))
         (ltext (string-to-list utext)))
    (apply #'concat
     (mapcar (lambda (x) (format "%02x" x)) ltext))))


R.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]