[Pythonmac-SIG] Python+Automator?

Paul Berkowitz berkowit at silcom.com
Mon Jan 24 06:10:59 CET 2005


On 1/23/05 7:53 PM, "Bob Ippolito" <bob at redivi.com> wrote:

>>> Given the description, it would be trivial to write an Automator
>>> Action in PyObjC 1.2+ using the py2app plug-in bundle support.  I
>>> doubt I'll be using Automator often enough to become a PyObjC
>>> Automator evangelist though.
>> 
>> What's the advantage of PyObjC here? Just because it makes it easier
>> to write the plugin, or does it help with writing the Python code too?
>> 
>> Because I wouldn't mind having automator support in a future
>> "MacPython for Tiger additions"...
> 
> The advantage of PyObjC here is that there are two interfaces for
> creating plugins: Objective-C plugins that implement a certain method,
> and applescripts that implement a certain handler.  Since the latter
> isn't really possible to do with Python, that leaves PyObjC as the ONLY
> option, and it happens to be trivial to do.

Except that you can only write Objective-C Automator actions for Cocoa apps
which expose their entire APIs publicly. Only a few Apple apps do that.
Nobody else will do it - their developers might write their own Obj-C
actions but they won't open source their apps for others to do it. On the
other hand, all applescriptable apps are immediately accessible to
AppleScript Automator actions. You can cut out a lot of the "internal"
scripting by using Cocoa Bindings (as for Obj-C actions) but need
AppleScript to talk to the apps. Probably has's appscript will be able to do
the same in Python. I can't see how far anyone is going to get with PyObjC
except for their own apps, and Apple's Address Book, which Apple is already
providing many actions for.

-- 
Paul Berkowitz




More information about the Pythonmac-SIG mailing list