Travis Caldwell wrote:

Not sure if this is user error or a bug, but I can't seem to send the count command to Word 2008 via appscript.


Word's count command requires an 'each' parameter, e.g.:

app('microsoft word').count(each=k.document)

A number of Carbon apps do require an 'each' parameter, e.g. Word, Finder. The reason you can get away with not specifying one yourself in AppleScript is that AppleScript quietly munges the reference passed as the direct parameter to create one. Appscript mimics quite a bit of AppleScript's behind-the-scenes chicanery for compatibility's sake, but this isn't one of them. (The 'each' parameter is itself a design wart; Apple event IPC has a lot of those.) Adding a note about this particular issue to the FAQ is on the TODO list... along with the rest of the FAQ. (I'm afraid work's keeping me pretty busy these days, but fingers crossed it'll happen someday.)

HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to