[Openmcl-devel] AppleScript

Terje Norderhaug terje at in-progress.com
Wed May 13 05:02:41 UTC 2009


On May 12, 2009, at 8:19 AM, Gary Byers wrote:
> There was an F-Script<->OpenMCL interface once upon a time:
>
> <http://www.clozure.com/pipermail/openmcl-devel/2003-February/ 
> 004561.html>
>
> There was also a way of compiling and executing AppleScript  
> (without running
> an external program.)  I suspect that the stuff that I'm thinking  
> about
> is what's described at:
>
> <http://developer.apple.com/documentation/Carbon/Reference/ 
> Open_Scripti_Architecture/Reference/reference.html>
>
> I don't think that there was ever any kind of high-level interface  
> to this
> in CCL (at least none that I know of), but IIRC it wasn't -that-  
> bad to just
> use the FFI (for some value of "not bad".)

MCL has several contributions supporting Applescript, including  
compiling and/or executing scripts from Common LISP. Perhaps these  
can be ported or used as a starting point? I have several related MCL  
contributions myself at <http://www.in-progress.com/src/> that makes  
MCL and its application OSA scriptable and recordable by implementing  
the classes and event handlers of the standard AppleEvent suites.

-- Terje Norderhaug

> On Tue, 12 May 2009, Steve Núñez wrote:
>> Thanks.
>>
>> Has anyone looked at F-Script? I discovered it while looking  
>> around for ways
>> I might script this application. I don't have any experience with  
>> it, but it
>> looks interesting:
>>
>>    http://www.fscript.org/
>>
>>    - Steve
>>
>> On 12/05/09 12:00 AM, "Daniel Dickison" <danieldickison at gmail.com>  
>> wrote:
>>
>>> I'm the author of cl-applescript, and you're right that it has been
>>> pretty much abandoned (the project I had originally wrote that  
>>> library
>>> for went defunct).  However, I believe it still works if you only  
>>> have
>>> simple AppleScript needs, with the following caveats:
>>> 1. All AS is executed using the osascript command line interface,
>>> which means:
>>> a. You can't construct AppleEvents programatically (you need to
>>> construct script strings).
>>> b. Every call has to compile the AppleScript from scratch, which is
>>> slow.
>>> c. The entire return value is stored as a string before parsing, so
>>> you wouldn't want to do huge queries.
>>> 2. Parsing dictionaries hasn't been implemented.
>>>
>>> The patch for CCL bug 216 should no longer be necessary if you're
>>> using CCL 1.3 (I should update that page).  If you would like to use
>>> the library but you need dictionary parsing, I think it should be
>>> pretty easy to implement and I'll be happy to help you with that.
>>>
>>> That said, Scripting Bridge is probably the way to go.  You'll be
>>> writing Cocoa code (presumably via the Clozure Objective-C bridge),
>>> but I believe you can use it to script any application,  
>>> regardless of
>>> whether it's Cocoa or Carbon.
>>>
>>> Daniel
>>>
>>>
>>> On May 11, 2009, at 4:40 AM, Steve Núñez wrote:
>>>
>>>> G¹Day Gentlemen,
>>>>
>>>> What¹s the Œstate of the art¹ for interfacing with Carbon
>>>> applications exposing only an AppleScript interface? I found one
>>>> possibility mentioned here:
>>>>
>>>> http://www.clozure.com/pipermail/openmcl-devel/2008-October/
>>>> 008618.html
>>>>
>>>> But this seems applicable only to Cocoa applications. There¹s also
>>>> cl-applescript:
>>>>
>>>> http://common-lisp.net/project/cl-applescript/
>>>>
>>>> But that project appears to have been abandoned. I¹m trying to
>>>> determine the feasibility of heavily customising MS Entourage, and
>>>> would like to use CCL for most of the heavy lifting.
>>>>
>>>> Regards,
>>>>     - Steve
>>>>
>>>> --
>>>> <image.gif>
>>>> Level 31
>>>> 6 Battery Road
>>>> Singapore 049909
>>>>
>>>> Phone:  +65 6321 9115
>>>> Mobile: +65 9679 8360
>>>> http://illation.com.sg
>>>>
>>>>
>>>> _______________________________________________
>>>> Openmcl-devel mailing list
>>>> Openmcl-devel at clozure.com
>>>> http://clozure.com/mailman/listinfo/openmcl-devel
>>>
>>
>> -- 
>>
>> Level 31
>> 6 Battery Road
>> Singapore 049909
>>
>> Phone:  +65 6321 9115
>> Mobile: +65 9679 8360
>> http://illation.com.sg
>>
>>
>>
>>
>> _______________________________________________
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
>> http://clozure.com/mailman/listinfo/openmcl-devel
>>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel




More information about the Openmcl-devel mailing list