• 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: Bill Cheeseman <email@hidden>
  • Date: Thu, 20 Jan 2005 18:47:07 -0500

on 2005-01-20 3:16 PM, Robert DeLaurentis at email@hidden
wrote:

> 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.

You should be able to read the presence or absence of the checkmark in the
popup blocker menu item using GUI Scripting.

The key line of the script might be this, retrieved using UI Browser:

 get value of attribute "AXMenuItemMarkChar" of menu item "Block Pop-Up
Windows"  of menu "Safari"  of menu bar item "Safari"  of menu bar 1

I don't have time just now to provide more hints. Except this: you might
have to click the menu to open it and 'delay 1' before reading the mark
character. Mark characters usually aren't set until the menu is opened.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes


 _______________________________________________
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

  • Follow-Ups:
    • Re: Scripting the GUI in Safari
      • From: Jean-Baptiste LE STANG <email@hidden>
References: 
 >Scripting the GUI in Safari (From: Robert DeLaurentis <email@hidden>)

  • Prev by Date: Re: How far back in Mac OS history do folder actions go?
  • Next by Date: Re: How far back in Mac OS history do folder actions go?
  • Previous by thread: Re: Scripting the GUI in Safari
  • Next by thread: Re: Scripting the GUI in Safari
  • Index(es):
    • Date
    • Thread