diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/gui.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/gui.html new file mode 100644 index 00000000000..e715de4aef1 --- /dev/null +++ b/Mac/OSXResources/app/Resources/English.lproj/Documentation/gui.html @@ -0,0 +1,55 @@ + + + + + Creating a User Interface with MacPython + + + + + +

Creating a User Interface with MacPython

+ +

There are a number of packages that allow creation of a user interface +for your Python code, each of which has its own merits:

+ + + +

For new work, however, one of the following packages may be better suited. +They may be available out of the box in this distribution, otherwise you +can install them through the Package Manager:

+ + + + + diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/index.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/index.html index b020d2f79a4..849548b5cf7 100644 --- a/Mac/OSXResources/app/Resources/English.lproj/Documentation/index.html +++ b/Mac/OSXResources/app/Resources/English.lproj/Documentation/index.html @@ -30,6 +30,8 @@
  • Running Python scripts from the Finder
  • Running Python scripts from the Unix Shell +
  • Creating a User Interface with MacPython +
  • Controlling other Applications from MacPython
  • Installing additional functionality with the Package Manager
  • diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/scripting.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/scripting.html new file mode 100644 index 00000000000..9d2fe0e1032 --- /dev/null +++ b/Mac/OSXResources/app/Resources/English.lproj/Documentation/scripting.html @@ -0,0 +1,51 @@ + + + + + Controlling other Applications from MacPython + + + + + +

    Controlling other Applications from MacPython

    + +

    Python has a fairly complete implementation of the Open Scripting +Architecure (OSA, also commonly referred to as AppleScript), allowing +you to control scriptable applications from your Python program, +and with a fairly pythonic interface. The following pieces of +AppleScript and Python are rougly identical (XXXX Not true right now!):

    + +
    +tell application "Finder"
    +	get name of window 1
    +end tell
    +
    + +
    +import Finder
    +
    +f = Finder.Finder()
    +print f.get(Finder.window(1).name)
    +
    + +

    To send AppleEvents to an application you must first create the Python +modules interfacing to the terminology of the application (what +Script Editor calls the "Dictionary"). Use the IDE menu command +File->Generate OSA Suite... for this. For more control run

    + +
    +pythonw .../Lib/plat-mac/gensuitemodule.py --help +
    + +

    from a terminal window.

    + +

    Creating a scriptable application in Python

    + +You can also create a scriptable application in Python, but this is not +very well documented. For Carbon +applications you should look at the MiniAEFrame module. + + +