Re: Script not waiting for completion of Eudora task
Re: Script not waiting for completion of Eudora task
- Subject: Re: Script not waiting for completion of Eudora task
- From: "Marc K. Myers" <email@hidden>
- Date: Mon, 04 Dec 2000 13:05:16 -0500
- Organization: [very little]
Max Bonilla wrote:
>
I don't think that the program is returning a false indicator. I
>
think it is just busy doing what was told, and that AppleScript
>
assumes it has been done and moves on, while a backup is still being
>
done or whatever. I have assumed that the problem is a beginner one
>
(as I am one), because I always understood AS to be perfectly suited
>
to control workflows. If AS moves on during a simple process because
>
it did not understand an Apple Event or some other signal (that the
>
expected command is executing), then my assumption is that I have not
>
told AS what to do correctly. I could use a timeout, but like I said
>
I don't want an artificial pause. That would be prone to errors (if
>
my timeout is too short) or delays (if it is too long). And since
>
the processes that I would like to manage often vary in length from
>
day to day, either of the two is bound to always happen (delays,
>
preferably).
>
>
Thanks.
>
>
Max
>
>
>If the program's returning a false indicator that it has completed its
>
>task, using "with timeout" wouldn't do any good, anyway. The only thing
>
>that might work is if there's a way to inquire about something that
>
>would tell you if the task was completed or not. With more recent
>
>versions of the OS (which I don't have) I believe you can inquire as to
>
>whether or not a file is "busy". If the app closes a file when it's
>
>done, that would do the trick. Put a busy test into an idle handler and
>
>don't continue until you get a false condition.
>
>
>
>Marc [12/2/00 11:10:47 PM]
>
>
>
>
>
>Max Bonilla wrote:
>
>>
>
>> I have the same problem with a Retrospect script and I don't use
>
>> "Ignoring application responses ... end ignoring". What I think
>
>> happens is that the application might send a confirmation that the
>
>> process was done (i.e., started) without consideration for how long
>
>> it's taking, and therefore the script just moves on. As Rob, I would
>
>> like to know how to control the script. I would not want to use
>
>> "with timeout" because I don't want to give an artificially long
>
>> period of time; I would want the script to continue as soon as the
>
>> process is over, but not before.
>
>>
>
>> Max
>
>>
>
>> >Rob Jorgensen wrote:
>
>> > > I'm working on a script which tells Eudora to check the mail, and
>
>> >> then, based on the results of that check, do some other stuff.
>
>> >>
>
>> >> The script, in its present form, tells Eudora to check the mail, but
>
>> >> doesn't wait for the check to complete before proceeding. I've tried
>
>> >> adding a pause between 2 separate tell statements to Eudora, but the
>
>> >> pause ends up pausing Eudora in the middle of it's mail check and
>
>> > > then the script proceeds before Eudora is finished checking.
>
>> >
>
>> >If your script isn't waiting for the completion of the Eudora task,
>
>> >should I assume that you've got the tell block to Eudora bracketed by
>
>> >"ignoring application responses...end ignoring"? If so, change that to
>
>> >"with timeout of n seconds...end timeout" and give "n" a large enough
>
>> >value that it won't timeout before Eudora is done with its task.
>
>> >
>
>> >Marc [12/2/00 9:17:04 PM]
Under normal circumstances, when AppleScript tells an application to do
something, the application performs the task and then signals
AppleScript that the task has been completed. AppleScript waits for
that reply before continuing on with the script. There is no mechanism
for "AppleScript assumes it has been done and moves on". Unless the
"tell" is bracketed by "ignoring...end ignoring", the script waits until
the application reports back that the task is done. When I said that
Eudora was returning a false indicator, I meant that it was telling
AppleScript that it was done with its task when that was not the case.
Otherwise, the script would not have moved on to the next command.
There is, AFAIK, no way for you to "have not told AS what to do
correctly" that would cause this to happen.
Marc [12/4/00 1:03:23 PM]