Re: Beeping Beeper
Re: Beeping Beeper
- Subject: Re: Beeping Beeper
- From: Chris Page <email@hidden>
- Date: Mon, 31 Aug 2009 18:14:07 -0700
On Aug 30, 2009, at 3:23 PM, Luther Fuller wrote: Using 'beep 2' causes a "beep be" sound. Using just 'beep' results in silence or a short "be” sound.
This is almost certainly due to the sound playing asynchronously and then getting cut off when the script application process ends before the sound has completed. Any process that plays sound asynchronously will encounter this issue, and the solution is to delay quitting until the sound completes. For example, on my machine the “Funk” beep plays fully, but “Hero” is long enough that the second beep may not finish. To ensure that the sound plays fully, add a “delay 1” (or however long the beep is) after the beep command to ensure it is allowed to completely play before the process ends. You can do this immediately after the beep, or you can define a “quit” handler that always delays before quitting:
beep 2
on quit delay 1 end quit
Note that if you use “beep” without a parameter, it plays asynchronously. If you give it a number, it will wait for all but the last one to complete before playing the next one.
-- Chris Page
The other, other AppleScript Chris
|
_______________________________________________
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