• 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
with timeout / try & on error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

with timeout / try & on error


  • Subject: with timeout / try & on error
  • From: James Nierodzik <email@hidden>
  • Date: Mon, 21 May 2007 16:49:40 -0500

Howdy scripters, I'm hoping someone here can lead me to a solution of sorts.  What I'm trying to do is something along the lines of this....

try
with timeout of x seconds
-- meat & potatoes
end timeout
on error errMsg number errNUm
-- was hoping to catch any errors or the time out here for
-- log writing purposes
end try

While I was attempting to get there though I was testing timeout and realized this doesn't work 

set x to 0
with timeout of 1 second
repeat with i from 1 to 10000000
set x to x + 1
end repeat
end timeout

because timeout apparently doesn't work with multiple statements :(  Fine.  I can, for the most part, work around that.  So I tried this instead

with timeout of 1 second
mount volume "<protocol>://<user>:<pass>@<ip>/<share>"
end timeout

Well my server (a sad, tired, overworked beast for testing) usually takes about 5 seconds to wake up so I thought I could come up with a good test…
Well the timeout never triggered and eventually my share mounted.

So any idea why timeout isn't working?  Any ideas how I can get to my original goal?

Thanks in advance and happy scripting!


James Nierodzik
email@hidden

17" MacBook Pro    Mac OS X (10.4.9)   Scripts written with Script Debugger 4 / PreFab UI Browser


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: with timeout / try & on error
      • From: Emmanuel <email@hidden>
    • Re: with timeout / try & on error
      • From: Bill Briggs <email@hidden>
  • Prev by Date: version numbers
  • Next by Date: Re: Path to library folder w/ network home directory?
  • Previous by thread: Re: version numbers
  • Next by thread: Re: with timeout / try & on error
  • Index(es):
    • Date
    • Thread