Re: Beeping Beeper
Re: Beeping Beeper
- Subject: Re: Beeping Beeper
- From: Deivy Petrescu <email@hidden>
- Date: Sun, 30 Aug 2009 21:06:21 -0400
On Aug 30, 2009, at 8:43 PM, Luther Fuller wrote: On Aug 30, 2009, at 6:59 PM, Deivy Petrescu wrote: Luther
run the following script:
tell application "Finder" beep 2 end tell
It will beep but if you inspect the events, you will see that there is an error for every time the beep is called from within the Finder tell block.
This reminds me of a discussion we had with "the other AppleScript Chris" :) about not doing this any longer.
Well, as an Apple engineer he managed to accomplish that. :(
Still, the command eventually beeps twice because ASE calls Applescript to beep (actually SA).
Yes, when I edited my script, I found my 'beep' command inside a tell Finder block. I moved it out of this block, but that didn't help. I then isolated the Finder block in the run handler to a main() handler so I now have ...
on run activate try -- front window may not be folder/disk window my main() my beeper() on error errText number errNr
Using 'beep' in place of 'my beeper()' does NOT help. It seems most likely that I'm doing something to the Finder that's killing the beep. There's lots of window opening and closing and item selecting, but I don't yet have a clue about the specific cause. And 'beep' is a Scripting Addition command, it should not be affected by the Finder. Right?
Right!
However, it will produce an error in the log pane:
tell application "Finder" beep 2 --> error number -10004 end tell tell current application beep 2 end tell
This will happen in many instances. Even if there is an error trap, this would not prevent it from beeping. That is, this beeps.
tell application "Finder" try beep 2 on error e say e end try end tell
|
_______________________________________________
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