• 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: Mail scripting... try with a time limit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail scripting... try with a time limit


  • Subject: Re: Mail scripting... try with a time limit
  • From: Christopher Nebel <email@hidden>
  • Date: Wed, 28 Nov 2007 19:05:18 -0800

On Nov 28, 2007, at 8:51 AM, Bob Cuilla wrote:

I am scripting mail and would like to specify a try block but need a time limit.

...

This all works OK as long as there is some content in that specified mailbox, or as long as the servers arent slow or down.

Can I surround any or all of these statements with try--end trys and a timer? My issues occurs when statements 4 thru 6 are waiting for mail to respond. I would like to put a time limit on that area and exit with a different path if there is a time out. Hope this all makes sense to someone who is a lot smarter than me.

Sounds like you want a "with timeout" block.

with timeout of 100 seconds -- it's always seconds; do math if you need a number of minutes.
-- do stuff here
end


Bear in mind that the timeout time applies to each individual application command in the block, not to the block as a whole. That is, statement one has up to 100 seconds to finish, then statement two has up to 100 seconds to finish, and so on.


--Chris Nebel AppleScript Engineering

_______________________________________________
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
References: 
 >Mail scripting... try with a time limit (From: Bob Cuilla <email@hidden>)

  • Prev by Date: Re: Creating a script that can set its own modification date
  • Next by Date: Re: Leopard changes how to get attachments from mail messages
  • Previous by thread: Re: Mail scripting... try with a time limit
  • Next by thread: iTunes: Adding tracks with missing files to playlist seems impossible
  • Index(es):
    • Date
    • Thread