[Pythonmac-SIG] Applevents to running applications..

Bill Bedford billpy@mousa.demon.co.uk
Wed, 15 Jul 1998 19:39:01 +0100


At 7:08 pm +0200 15/07/98, Th. Fettig wrote:

~I am doing a workflow-component using Python as 'steering' and
~interface to our database, and would need to talk to various
~Applescripts i wrote (saved as application..) via the default
~handlers (run,open,save,quit). Has anybody done this yet?

You can do this via the finder eg Using the distribution file

import aetools
import Finder_Suite
import Standard_Suite


class Finder(aetools.TalkTo,  Finder_Suite.Finder_Suite,
Standard_Suite.Standard_Suite):
	"""A class that can talk to Finder"""
	pass

f = Finder('MACS')


ScriptApp = "Hermit:Desktop Folder:testscrpy"

ff = Finder_Suite
ss = Standard_Suite

f.open(ss.file(ScriptApp))




Or using PythonScript

import PythonScript

SIGNATURE = 'MACS'
TIMEOUT = 10*60*60

ScriptApp = "Hermit:Desktop Folder:testscrpy"

PythonScript.PsScript(SIGNATURE, TIMEOUT)
p = PythonScript.PyScript
ev = PythonScript.PsEvents
pc = PythonScript.PsClass

print p(ev.Open, pc.File(FILE))


~ I looked
~around for a while, but only found facilities to use converted
~Dictionaries.. which is totally dependent on signatures, but these
~do not differ for Applescripts!!

The idea of these modules was to replace applescripts with python scripts.



Bill Bedford

Owner Brit_Rail-L list for the history of railways in Britain
Subscribe at autoshare@mousa.demon.co.uk