Commit b6035299 authored by Jack Jansen's avatar Jack Jansen

The minimal scripting example now actually works.

parent 9dd78101
...@@ -14,15 +14,9 @@ ...@@ -14,15 +14,9 @@
<p>Python has a fairly complete implementation of the Open Scripting <p>Python has a fairly complete implementation of the Open Scripting
Architecure (OSA, also commonly referred to as AppleScript), allowing Architecure (OSA, also commonly referred to as AppleScript), allowing
you to control scriptable applications from your Python program, you to control scriptable applications from your Python program,
and with a fairly pythonic interface. The following pieces of and with a fairly pythonic interface. This piece of
AppleScript and Python are rougly identical (XXXX Not true right now!):</p> Python:</p>
<blockquote><tt><pre>
tell application "Finder"
get name of window 1
end tell
</pre></tt></blockquote>
<blockquote><tt><pre> <blockquote><tt><pre>
import Finder import Finder
...@@ -30,6 +24,14 @@ f = Finder.Finder() ...@@ -30,6 +24,14 @@ f = Finder.Finder()
print f.get(Finder.window(1).name) print f.get(Finder.window(1).name)
</pre></tt></blockquote> </pre></tt></blockquote>
<p>is identical to the following piece of AppleScript:</p>
<blockquote><tt><pre>
tell application "Finder"
get name of window 1
end tell
</pre></tt></blockquote>
<p>To send AppleEvents to an application you must first create the Python <p>To send AppleEvents to an application you must first create the Python
modules interfacing to the terminology of the application (what modules interfacing to the terminology of the application (what
<tt>Script Editor</tt> calls the "Dictionary"). Use the IDE menu command <tt>Script Editor</tt> calls the "Dictionary"). Use the IDE menu command
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment