|
From: Kevin W. <kw...@co...> - 2009-08-08 19:08:12
|
I'm investigating options for making a Tk/Mac application scriptable via AppleScript and/or Apple Events. Looking around, I see the TclAE extension, and I also see the tkMacOSXHLEvents.c in the Tk-Aqua core. Both appear to support a command called "do script" which, if I'm reading the code and /or docs correctly, allows a user to send a Wish-based application an AppleScript command called "do script" followed by Tcl commands or script. There are also various Apple event handlers defined in tkMacOSXHLEvents.c, such as ::tk::mac::OpenDocument and ::tk::mac::PrintDocument. If these procedures are defined, does this mean that a Tk application would respond to standard AppleScript commands as "launch," "open document," "print document," etc? Is there anything else that one needs to do, i.e. set the "scriptable" setting in Info.plist, to allow it to respond to external AppleScript commands? Also, is there a way to expand more of an app's functionality to AppleScript (perhaps by mapping an AppleScript dictionary of commands onto Tk commands)? Thanks for any advice, Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com |