fbartlet wrote:

I have a mess of VBA and AppleScript scripts I wrote to automate Word & ChemDraw tasks. Now that everyone who needs this stuff has access to OS X, I thought I might try Python to make some improvements I've been asked for and which VBA and AppleScript don't seem to be able to deliver.

Depends on the reason _why_ they can't deliver. If the limitation is in the application APIs, there's not much you can do about that except file a feature request with the application developer. But if it's just the language that's being lame and obnoxious then you can probably do something about that by switching to Python. Here's a link to Python's new application scripting support package (c/o yours truly):


http://freespace.virgin.net/hamish.sanderson/appscript.html


While I've used Python to script Word under Windows, I'm not terribly knowledgeable about Macs; so any and all clues will be received gratefully.

Word 2004 has a much expanded Apple event interface compared to previous versions. I think it's basically just a thin wrapper around the API used by VBA, so not very Mac-like but pretty comprehensive.


The MacScrpt mailing list <http://listserv.dartmouth.edu/scripts/wa.exe?A0=macscrpt&D=1&H=0&O=D&T=1> has various crusty old application scripters who can advise on application-specific issues. Paul Berkowitz might be a particularly good person to answer Word scripting questions as he does a lot of scripting of Office apps (he sometimes posts on this list as well, so say his name three times and maybe he'll appear;).

I've yet to write up a proper introduction to Mac application scripting and appscript, but if you dig around the PythonMac SIG archives there's been a few threads discussing application scripting theory and principles. And if you're familiar with AppleScript then you shouldn't have any problems with appscript - the syntactic sugar is slightly different, but it behaves just about the same - see the appscript documentation for caveats and instructions.

HTH

has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to