Re: [Pyobjc-dev] Python as an AppleScript Replacement?
Brought to you by:
ronaldoussoren
From: Peter M. <zig...@po...> - 2003-03-02 07:47:04
|
On Sunday, March 2, 2003, at 06:05 PM, Ronald Oussoren wrote: > > On Sunday, Mar 2, 2003, at 07:10 Europe/Amsterdam, Peter Montagner > wrote: > >> I don't know if this has been asked before (I couldn't access the >> list archives) but has anyone thought of using PyObjC as an >> AppleScript replacement? Complete Open Scripting Architecture >> compliance (Script Editor support, etc) probably isn't worth it but >> what about doing something functionally similar? Something like: > > Did you look at the OSA support in MacPython? It already does most of > what you want, adding the missing features is probably less work than > starting from scratch. I may be missing something, but I thought that MacPython's OSA support was limited to the AppleEvents level. AppleEvents are the low level interapplication messaging protocol. The code would still be useful of course, but it wasn't what I was thinking of (unless I'm missing something). You *could* look up the 4 char AppleEvent codes for the call you want manually and then send them and wait for a response, but this is nothing like osa.getApp("Finder").empty_trash. It is the core though. Here's what emptying the trash is like with AppleEvents (pseudocode, but you get the idea): AppleEvent ('MACS', 'fndr', 'empt', '----', objspec ('trsh')) Not pleasant, and that is a simple example. Peter |