• 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: Alex Zavatone <email@hidden>
  • Date: Tue, 10 Mar 2015 12:12:05 -0400

In the past, when I wrote something like this, I would call it something like "doDelay" or "doSleep", just to make sure there was no method name collision.

AppleScript seems weird sometimes just how it will not require parent on functions.  The closest I can recall is from Director's Lingo where parens were only required if the function/method was to return a value and they were optional if you were just passing a value to it.

Sent from my iPad. Please pardon typos.

On Mar 10, 2015, at 11:23 AM, Yvan KOENIG <email@hidden> wrote:

>
>> Le 10/03/2015 à 16:11, Robert Poland <email@hidden> a écrit :
>>
>> Randy,
>>
>> The script, below, seems weird to me.
>>
>> 1. How come the delay command uses the handler?
>>
>> 2, How come the handler works without the normal parentheses?
>>
>> 3. Could I add the handler to all scripts that use the delay command?
>>
>> 4. Would the command “Delay” also call the handler?
>>
>> # script
>> on delay delayTime
>>    set theRepeat to delayTime * 10 div 1
>>    repeat theRepeat times
>>        do shell script "sleep 0.1"
>>    end repeat
>> end delay
>>
>> beep
>> delay 2
>> beep
>> #/script
>>
>> Tia,
>>
>> Robert Poland
>> Fort Collins CO
>
> I'm surprised by the fact that there is no conflict between the handler named delay and the delay command belonging to AppleScript itself.
>
>
> As it works as it, you just need to paste the handler at the end or at the beginning of your scripts.
> Every delay integerValue will no longer execute the AppleScript command but will trigger the handler.
>
> Yvan KOENIG (VALLAURIS, France) mardi 10 mars 2015 16:22:56
>
>
> _______________________________________________
> 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

 _______________________________________________
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: Don't understand delay action
      • From: "Stockly, Ed" <email@hidden>
References: 
 >Don't understand delay action (From: Robert Poland <email@hidden>)
 >Re: Don't understand delay action (From: Yvan KOENIG <email@hidden>)

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