• 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: Don't understand delay action
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Don't understand delay action


  • Subject: Re: Don't understand delay action
  • From: Shane Stanley <email@hidden>
  • Date: Wed, 11 Mar 2015 14:43:44 +1100

On 11 Mar 2015, at 2:38 pm, Robert Poland <email@hidden> wrote:
>
> 4. errors.

Ah, I mis-read what you meant.
>
> Here’s the handler I ended up with.
>
> on delay delayTime
> 	try
> 		set theRepeat to delayTime * 10 div 1
> 		repeat theRepeat times
> 			do shell script "sleep 0.1"
> 		end repeat
> 	on error # catch, no parameter, default time - 1 second
> 		repeat 10 times
> 			do shell script "sleep 0.1"
> 		end repeat
> 	end try
> end delay

According to the dictionary, delay without an argument defaults to a delay of 0, not 1. So you're avoiding the error, but doing something different.

But why delay for 0?

--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>


 _______________________________________________
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: 
 >Don't understand delay action (From: Robert Poland <email@hidden>)
 >Re: Don't understand delay action (From: Yvan KOENIG <email@hidden>)
 >Re: Don't understand delay action (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Don't understand delay action
  • Next by Date: Throwing Errors in Functions?
  • Previous by thread: Re: Don't understand delay action
  • Next by thread: Throwing Errors in Functions?
  • Index(es):
    • Date
    • Thread