• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Beeping Beeper
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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




Deivy Petrescu
email@hidden



 _______________________________________________
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

  • Follow-Ups:
    • Mac OS X 10.6 Snow Leopard security changes for scripting additions (was Re: Beeping Beeper)
      • From: Chris Page <email@hidden>
References: 
 >Beeping Beeper (From: Luther Fuller <email@hidden>)
 >Re: Beeping Beeper (From: Deivy Petrescu <email@hidden>)
 >Re: Beeping Beeper (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: AppleScript Editor
  • Next by Date: another interesting bug.
  • Previous by thread: Re: Beeping Beeper
  • Next by thread: Mac OS X 10.6 Snow Leopard security changes for scripting additions (was Re: Beeping Beeper)
  • Index(es):
    • Date
    • Thread