Added a link to Clozure CL's bug #216, which contains a patch necessary for cl-applescript.
Added initial web page and files.
cl-applescript provides an easy-to-use API for making AppleScript calls from Common Lisp and translating AppleScript's output to Common Lisp structures.
This is still a work in progress; currently only SBCL and CCL are supported, and the output translation does not handle dictionaries nor «foo ...» forms other than «class ...» and «data ...».
Also, this requires Mac OS X Leopard (10.5) which made AppleScript fully Unicode-compatible
The following symbols are exported from the cl-applescript package:
run-applescript scriptparse-applescript-output str [start]Parses output from AppleScript by recursively reading lists, strings, numbers, symbols, class names and hex-encoded binary data. The following grammar (roughly) describes the AppleScript output format:
as-object := as-list | as-string | as-number | as-symbol | as-binary | as-class
as-list := '{' [as-object] [, as-object]* '}'
as-class := '«class ' as-symbol '»'
as-binary := '«data ' [hex]* '»'
as-string := '"'string'"'
as-number := 0-9[.0-9]
as-symbol := characters
The tricky part is that AppleScript symbols can include spaces, so a symbol is only terminated if a comma, }, » or EOF are encountered. Symbols are interned in the package designated by *applescript-symbol-package* which defaults to the keyword package, with spaces replaced by hyphens. Class names are simply interned in the same way as regular symbols. Other «foo ...» structures are possible, but only «data ...» and «class ...» are currently supported. Also, named lists (i.e. dictionaries) of the form {key:value, ...} are not supported.
native-namestring path*applescript-symbol-package*(asdf-install:install :cl-applescript)There is a Darcs repository for this project.
http://common-lisp.net/project/cl-applescript/darcs/cl-applescriptPlease mail the mailing list with comments, patches, bug reports, etc.