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.


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to