Input without blocking

exec “osascript -e ‘beep 1’”

Or, better yet, get ahold of osx/aeosa and use those bindings.

Chris A. wrote:

exec “osascript -e ‘beep 1’”

Or, better yet, get ahold of osx/aeosa and use those bindings.

cin >> blocks. cin is basically the same thing as gets. I guess I will
just use a thread, but it seems kind of pointless to make the processor
have to schedule just for input.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mar 28, 2006, at 11:21 AM, Ernest Obusek wrote:

I wrote a little timer application and I would like it to play a
sound when the timer has counted down to 0.

You could always try RubyCocoa. From the main page (http://
RubyCocoa - Documentation):

The next script plays all the system sounds.

require ‘osx/cocoa’
snd_files =ls /System/Library/Sounds/*.aiff.split
snd_files.each do |path|
snd = OSX::NSSound.alloc.
initWithContentsOfFile_byReference (path, true)
snd.play
sleep 0.5
end

Alpha Chen
0xCDE1AD58 on keyserver.net

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFEKWnCTm5GrM3hrVgRAj3zAJ4tiRkOE4YgVoQQYP3f5opN7yjgmACgmpSK
dRXzk95XsgMd4kJvuoHq+WY=
=CMM9
-----END PGP SIGNATURE-----

On Mar 28, 2006, at 11:55 AM, Chris A. wrote:

exec “osascript -e ‘beep 1’”

I hope you never want to return after beeping

This is awesome! Thank you!

It isn’t so much that I never want to return as that I want to become
one with the osascript and exit after beeping =)

My bad, meant ‘system’ not ‘exec’; too much tcl in my past.