• 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: Open Safari in fullscreen and hide toolbar script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open Safari in fullscreen and hide toolbar script


  • Subject: Re: Open Safari in fullscreen and hide toolbar script
  • From: Yvan KOENIG <email@hidden>
  • Date: Fri, 31 Jul 2015 20:52:26 +0200


Le 31/07/2015 à 20:06, Ball, Dan <email@hidden> a écrit :

You know what, I have no idea.  The script was from 10.7 and has been
working ever since without issue and I upgraded to 10.10 and the script
stopped working.  The last two parts pretty much do the same thing, I
think, so I’m not sure.  All I can figure is that the first one wasn’t
working and I added the other part in without commenting it out or
something.  I didn’t notice it till you said something.

The delay 10 at the beginning was so when the machine is first turned on
to give it time for the computer to catch up as the script runs on login.

I’m not sure why I had these two things in there?:

tell application "System Events"
tell application process "Safari"
try
click menu item “Always Show Toolbar" of menu 1 of menu bar item "View"
of menu bar 1
end try
end tell
end tell

delay 3

tell application "System Events"
tell application process "Safari"
perform action "AXShowMenu" of toolbar 1 of group 2 of window 1
key code 125
keystroke return
end tell
end tell



Thanks for the help!

-Dan

As far as I know, there is no menu item “Always Show Toolbar" in Safari.
There is one item which may be : "Hide toolbar" or "Show toolbar"

Here is the script without useless code.

I enhanced the code hiding the toolbar. Now it clicks the menu item 1 only if the toolbar is visible.

delay 10

tell application "Safari"
activate
close every window
open location "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

tell application "System Events" to tell process "Safari"
set frontmost to true
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 tell


Yvan KOENIG (VALLAURIS, France) vendredi 31 juillet 2015 20:51:44




 _______________________________________________
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

  • Follow-Ups:
    • Re: Open Safari in fullscreen and hide toolbar script
      • From: Christopher Stone <email@hidden>
References: 
 >Re: Open Safari in fullscreen and hide toolbar script (From: "Ball, Dan" <email@hidden>)

  • Prev by Date: Re: Open Safari in fullscreen and hide toolbar script
  • Next by Date: Re: Open Safari in fullscreen and hide toolbar script
  • Previous by thread: Re: Open Safari in fullscreen and hide toolbar script
  • Next by thread: Re: Open Safari in fullscreen and hide toolbar script
  • Index(es):
    • Date
    • Thread