Re: Making a repeat loop without slowing CPU
Re: Making a repeat loop without slowing CPU
- Subject: Re: Making a repeat loop without slowing CPU
- From: Kai Edwards <email@hidden>
- Date: Thu, 18 Jul 2002 07:25:59 +0000
on Wed, 17 Jul 2002 18:55:31 EDT, email@hidden wrote:
>
I'm trying to write an AppleScript that will tell me when the movie thats
>
being downloaded into MoviePlayer has finished loading.
>
>
So far, I've got:
>
>
tell application "QuickTime Player"
>
activate
>
if the max time loaded of movie 1 = the duration of movie 1 then
>
display dialog "Finished loading movie!"
>
tell me to quit
>
end if
>
>
end tell
>
>
This works, but I need to put it into a repeat-loop of some sort. I thought
>
that if I did a SAVE with the "Stay Open" checkbox checked, that it would be
>
in a "repeated state" in a background mode. I think my perception of Stay
>
Open must be incorrect, as this check that I'm doing does not repeat itself
>
when I save in that fashion. Can anyone please steer me in the right
>
direction?
Try putting your script within an idle handler:
on idle
--insert your script here
return 2 -- the delay you require in seconds before the next check
end idle
Oh yeah - in this situation, you might also want to extend the dialog
specification to avoid offering a "Cancel" button - since choosing this
would leave the script open but doing nothing. Try something like this
instead:
display dialog "Finished loading movie!" buttons "OK" default button 1
HTH
Kai
--
email@hidden
email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.