Re: Scripting the GUI in Safari
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