Monday, October 21, 2002

Jon Udell has posted an article about Python as the "scripting language [to] drive a major, user-facing, GUI-intensive application". I have often wondered myself why Mahogany wasn't done in Python and wxPython instead of C++ and wxWindows.

We're exploring the scriptability of apps with PythonCard. Both the codeEditor and textEditor expose the Python shell, which is built-in to all PythonCard applications. However, rather than just having a menu item to hide and show the shell, we added the ability to run scripts, or Scriptlets as I like to call them which are analogous to the VBA scripts people can run in Microsoft Office.

The entire object model of a PythonCard application is exposed, so if an app doesn't have the feature you want, you can probably extend it with a short "macro" in Python. All scripts are run in the shell, so they share the shell namespace and thus scripts can share variables since the namespace doesn't go away until the application is closed. I posted an example of a scriptlet with the codeEditor back in May.

12:36:02 PM    comment []