• 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: Scripting the GUI in Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting the GUI in Safari


  • Subject: Re: Scripting the GUI in Safari
  • From: Andrew Oliver <email@hidden>
  • Date: Thu, 20 Jan 2005 14:50:31 -0800

On 1/20/05 12:16 PM, "Robert DeLaurentis" <email@hidden>
wrote:

> From this is this possible department:
>
> I would like a script to detect the of the popup blocker in Safari is
> currently enabled or disabled. I have a script that uses System Events
> to toggle it, but detect is another kettle of code. Is it even
> possible? The goal, simply stated, is to have a script disable the
> blocker if it is enabled, but otherwise do nothing.
>
> I took the GUI route because I did not see a way to get at that control
> any other way.
>
> Many thanks!
> Bob

The 'block popup windows' does set an option in the preferences, so you can
do this via 'defaults'. However, defaults can only read the saved setting
(not necessarily the current setting), and you can't change it while the app
is running (watch for line breaks):


--get current setting:
do shell script "defaults read -app Safari
WebKitJavaScriptCanOpenWindowsAutomatically"

--disable popups
do shell script "defaults write -app Safari
WebKitJavaScriptCanOpenWindowsAutomatically-bool false"

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Scripting the GUI in Safari (From: Robert DeLaurentis <email@hidden>)

  • Prev by Date: How far back in Mac OS history do folder actions go?
  • Next by Date: quoted escaped form of *&)%:""/
  • Previous by thread: Scripting the GUI in Safari
  • Next by thread: Re: Scripting the GUI in Safari
  • Index(es):
    • Date
    • Thread