Re: Open Safari in fullscreen and hide toolbar script
Re: Open Safari in fullscreen and hide toolbar script
- Subject: Re: Open Safari in fullscreen and hide toolbar script
- From: "Ball, Dan" <email@hidden>
- Date: Sat, 01 Aug 2015 15:39:32 +0000
- Thread-topic: Open Safari in fullscreen and hide toolbar script
Thank you all for the help, especially Yvan! Wouldn¹t have figured it
out without the help! Was a little more difficult than I thought it would
be!
Sorry for the confusionŠ.I was at work and every single time I went to
write an email or mess with the script I would get interrupted.
Thanks again,
Dan
>Hello
>We were unable to guess that the asker run El Capitan.
>
>Here is a script doing the job under this new OS and under older ones.
>
>I tried to borrow a piece of code to Christopher Stone but I discovered
>that it fails if there is no Safari window already open:
>error "Erreur dans Safari : Il est impossible d¹obtenir window 1. Index
>non valable." number -1719 from window 1
>
>
>tell application "Safari"
> activate
> close every window
> tell me to open location "http://www.google.com <http://www.google.com/>"
> repeat # Wait until the window is really available
> delay 0.1
> if exists window 1 then exit repeat
> end repeat
>end tell
>
>set sysVersion to (system attribute "sys2")
>
>tell application "System Events" to tell process "Safari"
> set frontmost to true
> if sysVersion > 10 then
> # Here running under El Capitan (10.11)
> keystroke "f" using {command down, control down} # force full screen
>mode
>
>
> repeat
> tell me to delay 0.1
> if enabled of menu item 1 of menu 1 of menu bar item 5 of menu bar 1
>then exit repeat
> end repeat
>
>
> value of attribute "AXMenuItemMarkChar" of menu item 1 of menu 1 of
>menu bar item 5 of menu bar 1
> if result is not missing value then
> click menu item 1 of menu 1 of menu bar item 5 of menu bar 1
> end if
> else
> # Here running Yosemite or older OS
> if toolbar of window 1 is not {} then
> click menu item 1 of menu 1 of menu bar item 5 of menu bar 1
> end if
>
>
> keystroke "f" using {command down, control down} # force full screen
>mode
> end if
>end tell
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden