[Pythonmac-SIG] Passing Data: from AppleScript to argv(command line parameters)
Jack Jansen
jack@oratrix.nl
Thu, 24 May 2001 23:51:09 +0200
Recently, Advertising <adv.files@robbstucky.com> said:
> >There's currently no way to do this. Python accepts two appleevents,
> >open document and open app. And with open document it expects
> >documents (which are then added to sys.argv).
>
> Which python is preconfigured to accept 2 AppleEvents (open document /
> open app)?
> Interpreter,
> IDE,
> or SimpleScripts saved as Applets.
Interpreter does, and the first FSSpec will be used as the script to
execute, subsequent ones as argv[1], etc.
IDE does, and opens an edit window with the script.
scripts saved as Applets will also accept them and stuff them into
argv[1] etc.
> When you say "open document" do you mean opening the *.py file,
> or can I.......
>
> tell application "pythonUnspecified"
> open document FSSpec
> end tell
Yes, that's right. That's basically what the finder does when you
doubleclick a .py script.
> ps
> Stop the discrimination against and stereotyping of Advertisers!
Hehe, okay, I'll try to refrain from it. It's just my subconscious
kicking in now and again:-)
--
Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm