Re: Idle handling, just not grokking it.
Re: Idle handling, just not grokking it.
- Subject: Re: Idle handling, just not grokking it.
- From: Cornwall <email@hidden>
- Date: Thu, 15 Nov 2001 18:26:10 -0800
The Finder beeps 3
tell application "Finder" to beep 3
Corny
At 11:35 AM -0800 11/15/01, Christopher Nebel wrote:
>
You won't hear a beep if you try to beep just before exiting the program, but that's a different problem. This one is something else -- beep n appears to only beep once. I did a quick experiment, and it looks like the problem is that Mac OS X is too bloody fast.
>
>
"beep" calls the system routine SysBeep, which has played the sound asynchronously ever since -- um, at least System 7, I think. (They realized that otherwise, the beep prevented you from doing anything else while it was playing -- a major liability if your beep is more than a few tenths of a second long.) That means that SysBeep returns immediately, and "beep" goes and calls it again for the second beep, etc. On Mac OS 9 with a sufficiently fast machine (or a sufficiently long beep sound) you can hear the beeps overlaying each other a bit. Now enter Mac OS X: SysBeep returns so fast that all the beeps play almost exactly over each other, so it sounds like there's only one. If you throw enough in, you will hear them spread out -- try "beep 2000".
>
>
What you need to do is add some time between the beeps. "Delay" only takes an integral number of seconds (gotta fix that), and one second is too long, so you have to add a short do-nothing loop. On my machine (a 500MHz PowerBook G3), this works pretty well:
>
>
repeat 5 times
>
beep
>
repeat 50000 times
>
2 + 2
>
end repeat
>
end repeat
>
>
I'd be tempted to call this correct behavior, but it's too perverse, so I'll write a bug on it.