From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Executing Emacs Lisp through AppleScript on Mac OS X? Date: Sun, 18 Dec 2005 12:54:14 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <43A40BED.4090303@student.lu.se> <93457ff00512170541h217a7d5ay3eb55bd6a3bd466d@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1134878106 7759 80.91.229.2 (18 Dec 2005 03:55:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 18 Dec 2005 03:55:06 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 18 04:55:01 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Enpd4-0005Xl-P5 for ged-emacs-devel@m.gmane.org; Sun, 18 Dec 2005 04:54:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Enpdq-0005mf-Mx for ged-emacs-devel@m.gmane.org; Sat, 17 Dec 2005 22:55:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Enpdd-0005mZ-Te for emacs-devel@gnu.org; Sat, 17 Dec 2005 22:55:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Enpdc-0005mM-5u for emacs-devel@gnu.org; Sat, 17 Dec 2005 22:55:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Enpdc-0005mJ-1L for emacs-devel@gnu.org; Sat, 17 Dec 2005 22:55:08 -0500 Original-Received: from [133.82.132.2] (helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EnpgJ-0003Hz-Gy for emacs-devel@gnu.org; Sat, 17 Dec 2005 22:57:56 -0500 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id B317D2C87; Sun, 18 Dec 2005 12:54:14 +0900 (JST) Original-To: Presto W In-Reply-To: <93457ff00512170541h217a7d5ay3eb55bd6a3bd466d@mail.gmail.com> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:47979 Archived-At: >>>>> On Sat, 17 Dec 2005 15:41:17 +0200, Presto W said: > Just wanted to know if anyone else already thought of this or even > implemented it. Currently, underlying Apple event support is in the early stage and too weak to support AppleScript in general. It can react to incoming Apple events, but cannot return results or error messages to the caller. If this limitation is OK with you, the implementation would be as follows: (put 'emacs-suite 'mac-apple-event-class "EMAx") (put 'do-lisp 'mac-apple-event-id "Lisp") (defun mac-ae-do-lisp (event) (interactive "e") (eval (car (read-from-string (mac-ae-text (mac-event-ae event)))))) (define-key mac-apple-event-map [emacs-suite do-lisp] 'mac-ae-do-lisp) YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp