Re: Scripting Safari's Preferences window
Re: Scripting Safari's Preferences window
- Subject: Re: Scripting Safari's Preferences window
- From: Irwin Poche <email@hidden>
- Date: Sun, 13 Jul 2003 12:45:11 -0500
Barbara,
Fantastic. How did you know to use 3...of group1 of group 1...2 ?
-Irwin
On 7/13/03 12:12 PM, Barbara Mueller said:
>
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.
_______________________________________________
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.