• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: With timeout of
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: With timeout of


  • Subject: Re: With timeout of
  • From: email@hidden
  • Date: Sat, 9 Dec 2000 16:18:50 EST

In a message dated 12/8/00 16:42:22, email@hidden writes:

>my script keeps timing out. I need it to be used, and then open another
>app
>and wait till user is finished to select another app to open and so on.
>i
>have a with timeout of 100000 seconds which is over a day. after a minute
>it
>times out, and when i click edit it highlights the line in my on error.
>I
>think it may have to do with the tell me's, but i need the dialogs to be
>in
>the script's app. here it is, shortened:
>
>...yada yada yada
> tell application "Finder"
> try
> with timeout of 100000 seconds
> ...yada yada yada
> repeat
> tell me to set theApp to (choose from list theList
>with
>prompt "" default items {theApp} cancel button name "Quit") as text
> if theApp is "Ships" then
> ...yada yada yada
> else if theApp is "Other" then
> open theplug using alias (mpath & "Apps:Resedit")
> end if
> end repeat
> end timeout
> on error theerr number theenum
> tell me to display dialog "An error has occurred." buttons
>{"
>Description", "Quit"} default button 2
> if the button returned of the result is "Description" then
> tell me to display dialog "#" & theenum & return & return
>&
>theerr buttons "Quit" default button 1
> end if
> end try
> end tell
>________________


Hi,

since there is some waiting going on with a script, thats where 'idle' comes
in handy. You could rewrite it as an idle script that does things step by
step as it runs. Im not sure if this will help your script though.

something like:

property Counter = 0

on idle
if Counter = 0 then
do_the_first_step()
set the counter to 1
return 20
else if Counter = 1 then
is_the_first_step_done?()
yes: set Counter to 2
return 1
no: return 5
else if Counter = 2 then
do_the_second_step()
set Counter to 3
return 20
else
set Counter to 0
quit
end if
end idle


Regards,
John


  • Prev by Date: write as list doesn't work in OS 9.1
  • Next by Date: Disappearing script window
  • Previous by thread: Re: With timeout of
  • Next by thread: With timeout of
  • Index(es):
    • Date
    • Thread