• 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: Closing Safari JavaScript alerts and other modal windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Closing Safari JavaScript alerts and other modal windows


  • Subject: Re: Closing Safari JavaScript alerts and other modal windows
  • From: Deivy Marck Petrescu <email@hidden>
  • Date: Thu, 23 Apr 2009 15:52:10 -0400


On Apr 22, 2009, at 8:31 PM, Evan Chaney wrote:

Is there a way to close a _javascript_ alert in Safari using AppleScript?

For example, this site:

http://shopping.shinhancard.com

…displays a _javascript_ alert as soon as the page is loaded. I need to be able to close that alert so that browsing can continue uninterrupted.

I tried getting the frontmost window and closing it but Safari thinks the frontmost window is the actual browser window, not the dialog window.

Thoughts?

Evan Chaney _______________________________________________



Try this:

tell application "System Events"
set frontmost of process "Safari" to true
tell process "Safari" to keystroke return
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

References: 
 >Closing Safari JavaScript alerts and other modal windows (From: Evan Chaney <email@hidden>)

  • Prev by Date: Re: get type of selected finder item
  • Next by Date: Re: Compiled version runs, script version doesn't
  • Previous by thread: Closing Safari JavaScript alerts and other modal windows
  • Next by thread: get type of selected finder item
  • Index(es):
    • Date
    • Thread