On Jan 24, 2005, at 11:45, Paul Berkowitz wrote:
On 1/23/05 9:40 PM, "Bob Ippolito" <[EMAIL PROTECTED]> wrote:
You're totally wrong here. Automator actions *entirely separate* from applications! Apple applications will not and can not support Automator actions directly, but they may ship with Automator actions. Whether these actions communicate with their application via Apple Events, Distributed Objects, or simply link with the same code and do things directly is beside the point entirely.
Objective-C actions can perform a superset of what AppleScript actions can do, including sending apple events to other applications, so your rant makes no sense. Yes, you could use appscript from a PyObjC plugin. I would expect that the majority of actions that people will write in Python will do very little inter-application communication anyway and instead will do things that Python is significantly better than AppleScript at (doing stuff on a network, mangling files, calling into Objective-C frameworks, etc.).
I don't know why you call it a rant - you appear to be a bit deficient in
the politeness department. Is it really necessary to turn a conversation
into trading insults?
I called it a rant because the rest of the thread was about how Python can be used to write Automator Actions, and you were talking about something else entirely. I could've used a better word for it.
I've already made some AppleScript Automator actions, so I know how they
work, thanks. My Objective-C is more limited so I haven't tried one of those
yet. My reading of the docs, and what I was told by some Apple engineers,
implied pretty strongly that you'd have to have access to an application's
Cocoa APIs to be able to write an action controlling that application, which
I was saying was going to be unlikely unless it was your own application.
Controlling applications is something you can do with an Automator Action, but it is not what Actions do in the general sense. The way you worded your original response made it sound like controlling other applications is the only reason to use Automator. While it is a good reason, it is not the only reason, and certainly not the most compelling reason to use Python.
Also there are two Apple applications which expose their API's: one is
Address Book, and I think the other is iChat, so those are available. Of
course Objective-C and thus PyObjC are perfect for getting into frameworks
and the other stuff you mention. No dispute there. Perhaps we were talking
at cross-purposes. The docs mention that you can write "mixed mode" actions
that use both AppleScript and ObjC to do both. It hadn't occurred to me that
you might want to send raw AppleEvents from ObjC when AppleScript was
available, but OK. I suppose that's because I do a lot of AppleScript and
find it easier. If you'd really rather send AppleEvents between applications
then I'm glad you can do it. I did say that has's appscript would surely be
useful here.
While you can send raw AppleEvents from Objective-C, and it is often useful to do so, you certainly don't have to. NSAppleScript has been around since Mac OS X 10.2, and allows you to run AppleScript code from a file (by way of NSURL) or from a NSString. This may or may not be what they meant by "mixed mode" (though "mixed mode" is not mentioned in the public information, so I can't comment further).
-bob
_______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig