Something close, but not quite spot-on, to TrashMan’s last query.
Back in high school (20+ years ago AIIM), we had Apple //e’s. On those machines, ctrl-G invoked the system beep or bell, or whatever Apple was calling it then. I kind of miss it as a keyboard-based sound, speaker and volume test, but as the //e’s were abacuses compared to what we’re using nowadays, I can’t see myself running an emulator just to get a keystroke I remember fondly to work as it did. What I’d rather do is write a script that tells an always-on app like PlaySound to beep at full volume when ctrl-g is pressed. I have the script backgrounder and UI Element utilities that were recommended to me and others in different threads here on the forum, so any references to those will not fall on ignorant ears (or eyes as this is all type).
So while some of my other script ideas had more practical applications, this one is merely for nostalgia sake. Nonetheless, I’d appreciate prompt suggestions.
Silversleeves
Model: PowerMac G4 QS 1.25 Dual MDD
AppleScript: 1.9.3
Browser: Firefox 1.5.0.8
Operating System: Mac OS X (10.3.9)
Oh, the lengths that we go to relive the glory days…
Here’s a couple options…
If you’re willing to forgo the hotkey angle, and simply enjoy hearing the beep, then perhaps you could just write a simple script and find a happy home for it. You could put it in the dock, your apps folder, wherever… and just double click it to run it. If you’re using one of the many available app launchers that allows you to assign global hotkeys (sorry, don’t use any so can’t even recommend one by name) you could simply write a small script to beep when run and then use your app launcher to run it. This is the simplest way, and requires no system-level interaction.
The second option requires actually writing an application that would run in the background and listen for your key combo. While I certainly don’t question your motivations, this seems like an incredible length to go to simply for nostalgia’s sake… but who am I to judge . jonn8 posted some very nice code in this thread quite some time back, that should be all you need to do the job. This method involves manipulating and understanding cocoa and carbon code if you plan to do anything other than copy/paste, though, so be warned that this may get a bit complex if you decide to do anything more.
I saved an applet to play the system beep and set ctrl-g to launch it in AliasKeys. At first I wrote the applet to invoke Play Sound, but that was a hair off in timing, and I knew the quicker response would come from the Finder. So I rewrote it to tell the Finder to beep once. That worked great, except (and maybe I’m being a little picky-perfectionistic here) for a brief moment the applet name appears in the usual place in the menu bar. So I tried to hide the applet using set visible to false, but I keep getting the error “Can’t set visible to false.” I named the process (the applet’s name is Two-EE-Beep) in the set visible command to the Finder, and got a peculiar looking NSInvalid somethng-or-other error from that.
What happened to “set visible” in AppleScript in Panther? I read a few posts to other forums I perused via Google hits about its conspicuous absence, so I know this has been discussed before. Is there another command or routine to use to get the same result in the same time frame? This is the second flaw I’ve found in as many weeks (the first being the inability of 10.2’s AppleScript to beep in a modified Folder Action script). Except here it’s on my G4, in an OS X version that was touted from hell to Hoboken to be leaps and bounds better than its predecessor {sic}.
On top of which, AliasKeys itself (or rather the version I’m running – no chance at an upgrade as the new one is Tiger-only) isn’t directly scriptable. Unless there’s an exploitable easter egg like there was with Preview?
Help?
Silversleeves
Model: PowerMac G4 QS 1.25 Dual MDD
AppleScript: 1.9.3
Browser: Firefox 1.5.0.8
Operating System: Mac OS X (10.3.9)