• 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 17:12:06 +0200

As I am curious, I tried to guess what you are trying to achieve.
To do that I grabbed infos about the UI elements available in group 2 of window 1.
To do that, I ran this enhanced code :

--delay 10


tell application "Safari"


activate


close every window


open location "http://www.google.com"


end tell


--delay 2


tell application "System Events"


tell process "Safari"
set frontmost to true
try


--click menu item "Enter Full Screen" of menu 1 of menu bar item "View" of menu bar 1
keystroke "f" using {command down, control down}


end try


end tell


end tell


delay 2


tell application "System Events"


tell process "Safari"
set frontmost to true
try


--click menu item "Hide Toolbar" of menu 1 of menu bar item "View" of menu bar 1
click menu item 1 of menu 1 of menu bar item 5 of menu bar 1
end try


end tell


end tell


-- delay 3



tell application "System Events"
tell process "Safari"
set frontmost to true


class of every UI element of window 1
log result --> (*group, group*)
position of group 2 of window 1
log result --> (*0, 0*)
class of UI elements of group 2 of window 1
log result --> (*tab, group*)


-- properties of first tab  of group 2 of window 1 # doesn't compile
properties of first UI element of group 2 of window 1
log result --> (*class:tab, minimum value:missing value, orientation:missing value, position:0, 22, role description:groupe d’onglet, accessibility description:missing value, focused:false, title:missing value, size:1920, 24, value:radio button Google of tab group 1 of group 2 of window Google of application process Safari, help:missing value, enabled:missing value, maximum value:missing value, role:AXTabGroup, entire contents:, subrole:missing value, selected:missing value, name:missing value, description:groupe d’onglet*)

class of UI elements of first UI element of group 2 of window 1
log result --> (*button, radio button*)


class of UI elements of group 1 of group 2 of window 1
log result --> (*group, button, menu button, menu button, menu button, menu button, button, button, button, button, menu button, button, menu button, button, button, button, menu button, button, button*)


title of every menu button of group 1 of group 2 of window 1
log result --> (*Apple, Geek, iOS, stockage, langage, MacPlus, VPC*)


keystroke "f" using {command down, control down}


delay 0.1
perform action "AXShowMenu" of toolbar 1 of group 2 of window 1


key code 125


keystroke return


end tell
end tell


So, I guess that you are trying to trigger one of the menu buttons available in  group 1 of group 2 of window 1


Yvan KOENIG (VALLAURIS, France) vendredi 31 juillet 2015 17:11:50




 _______________________________________________
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

References: 
 >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