[Openmcl-devel] Applescript

Dan Knapp dankna at accela.net
Tue Feb 8 04:25:06 UTC 2005


   I forget who mentioned Applescript, but I just thought I'd point out 
this blog entry
in case not everybody reads Planet Lisp:

http://www.holygoat.co.uk/blog/entry/2005-02-04-1

   The relevant code snippet is:

(defun make-volume-up ()
   (let ((vu-event (make-instance 'ns:ns-apple-script
     :init-with-source #@"tell application \"iTunes\"\
  to set sound volume to (sound volume + 10)")))
     (send vu-event :compile-and-return-error
       (ccl::%null-ptr))
     (defun volume-up ()
       (send vu-event :execute-and-return-error
       (ccl::%null-ptr)))))

   It doesn't look at all difficult to turn this into a general-purpose 
framework for
calling Applescript.  Of course it would be nice to have things like 
Lisp wrappers
for the dictionary functions, but really, those could come later.  This 
still leaves
the hard part, which is making it so OpenMCL apps can be controlled by 
OSA.

-- Dan Knapp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1459 bytes
Desc: not available
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20050207/529c1bb3/attachment.bin>


More information about the Openmcl-devel mailing list