• 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 Safari's Preferences window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Safari's Preferences window


  • Subject: Re: Scripting Safari's Preferences window
  • From: Barbara Mueller <email@hidden>
  • Date: Sun, 13 Jul 2003 19:12:06 +0200

Hallo,

tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
click check box "Enable Java" of window "Security"
click check box "Enable plug-ins" of window "Security"
click check box "Enable JavaScript" of window "Security"
end tell
end tell

And this is the way, it works with GUI scripting:

tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
set WindowCount to count of windows
click menu item "Preferences
" of menu "Safari" of menu bar 1
repeat with x from 1 to WindowCount
set UIList to name of UI elements of every window
if last item of item x of UIList is "General" or ,
last item of item x of UIList is "Appearance" or ,
last item of item x of UIList is "Bookmarks" or ,
last item of item x of UIList is "Tabs" or ,
last item of item x of UIList is "AutoFill" or ,
last item of item x of UIList is "Advanced" then
set WindowName to name of window x
click button "Security" of tool bar 1 of window WindowName
click check box "Enable JavaScript" of group 1 of group 1 of window "Security"
else
click check box "Enable JavaScript" of group 1 of group 1 of window "Security"
end if
end repeat
end tell
end tell

The loop is here to find out about the window's name.

HTH
Barbara
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Scripting Safari's Preferences window
      • From: Irwin Poche <email@hidden>
  • Prev by Date: Re: Scripting Safari's Preferences window
  • Next by Date: Re: Scripting Safari's Preferences window
  • Previous by thread: Re: Scripting Safari's Preferences window
  • Next by thread: Re: Scripting Safari's Preferences window
  • Index(es):
    • Date
    • Thread