[Pythonmac-SIG] Applescript Confusion?

Bill Bedford billb@mousa.demon.co.uk
Mon, 4 Mar 2002 19:46:02 +0000


At 1:41 pm -0500 04/03/02, Benjamin Schollnick wrote:

>Folks,
>
>	I'm a little confused...
>
>	I'm attempting to help with simplifying some automation here...
>
>	I'd like to setup a Python program to automatically run some
>	Applescript commands here....
>
>	(Freehand 10, Open command...)
>
>	But I don't see any way to do the equivalent of:
>
>		tell application "Macromedia Freehand 10"
>			open "filename"
>		end tell
>
>	I suspect it's possible, but I'm not sure how to do it in
>	python...

First you have to run gensuitemodule on the applescript Xtra which 
will give you the whole of the AE commands to Freehand

you then use something like ( which actually opens a Illustrator file)

	import Freehand
	import StdSuites
	fh = Freehand.Freehand(start=1, timeout=10*60*60)
	std = StdSuites.StdSuites()
	fh.activate()
	fh.open(StdSuites.file(file +'.art'), Dialogs=0)

or if you are using  SYS.ARGV you use findertools

	findertools.launch(sys.argv[1])

which uses the finder to open the file in the files parent 
application and may cause problems if the application is not running 
and is slow to start.



-- 

Bill Bedford

You can win or you can have peace, but not at the same time.