Gaining control of a Scripted Application
Gaining control of a Scripted Application
- Subject: Gaining control of a Scripted Application
- From: Tim Barlow <b&email@hidden>
- Date: Sun, 28 Oct 2001 21:06:11 +1100
I'm having trouble getting my program to relinquish control to an
application that is called from an AppleScript that my application is
executing.
To be more precise, I have a REALBasic plugin that uses OSADoEvent to
run an AppleScript that calls Eudora to create an outgoing email.
Normally everything works fine, the AppleScript is called, Eudora is
launched, the email is created and the script returns an appropriate
value.
However, under certain circumstances Eudora wants to gain control to
obtain data from the operator. It posts a message dialog that alerts
the user that it wants your attention but the user is then unable to
switch control to Eudora. This situation remains until the script
times out.
I call the AppleScript (via OSADoEvent) specifying the standard user
modes of -
kAEWaitReply + kAEAlwaysInteract + kAECanSwitchLayer
and I also supply an Idle procedure that gives time for other
processes (and I've ascertained that it gets called correctly).
I can solve the problem by placing an activate statement in the
AppleScript to bring Eudora to the foreground and then issue an
'activate me' statement just before I leave the script. However, this
is messy and somewhat confusing for the user, I much prefer to leave
Eudora in the background throughout the process.
Can anyone spot what I'm doing wrong?
Thanks in advance for any help given.
--
G.P.O. Box 263 email :
mailto:email@hidden
Kingston :
mailto:b&email@hidden
Tasmania web :
http://www.kagi.com/b&bsoftware
Australia 7051. :
http://www.trump.net.au/~bbsoft/
ph/fax: +61 (03) 62 921162