[Pyobjc-dev] Python as an AppleScript Replacement?
Brought to you by:
ronaldoussoren
From: Peter M. <zig...@po...> - 2003-03-02 06:11:02
|
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: import osa finder = osa.getApp("Finder") finder.empty_trash() textEdit = osa.getApp("TextEdit") text = textEdit.doument[1].text print text to replace the AppleScript code: tell app "Finder" to empty trash tell app "TextEdit" theText = the text of the front document display dialog theText end tell Most of the code to do stuff like this is probably already present in PyObjC. Instead of getting class info from the ObjC runtime, you would read the application's .scriptSuite files, and instead of bridging to ObjC, you would be sending AppleEvents. Otherwise it should be pretty similar, right? So, is any of this possible? Peter |