Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The keyboard short-cut solution is not relevant anymore and unfortunately @Cameron solution didn't work for me either (I tried to debug it with no luck)</p> <p>Here is what works for me:</p> <pre><code>#!/bin/bash # `menu_click`, by Jacob Rus, September 2006 # # Accepts a list of form: `{"Finder", "View", "Arrange By", "Date"}` # Execute the specified menu item. In this case, assuming the Finder # is the active application, arranging the frontmost folder by date. osascript &lt;&lt;SCRIPT on menu_click(mList) local appName, topMenu, r -- Validate our input if mList's length &lt; 3 then error "Menu list is not long enough" -- Set these variables for clarity and brevity later on set {appName, topMenu} to (items 1 through 2 of mList) set r to (items 3 through (mList's length) of mList) -- This overly-long line calls the menu_recurse function with -- two arguments: r, and a reference to the top-level menu tell application "System Events" to my menu_click_recurse(r, ((process appName)'s ¬ (menu bar 1)'s (menu bar item topMenu)'s (menu topMenu))) end menu_click on menu_click_recurse(mList, parentObject) local f, r -- `f` = first item, `r` = rest of items set f to item 1 of mList if mList's length &gt; 1 then set r to (items 2 through (mList's length) of mList) -- either actually click the menu item, or recurse again tell application "System Events" if mList's length is 1 then click parentObject's menu item f else my menu_click_recurse(r, (parentObject's (menu item f)'s (menu f))) end if end tell end menu_click_recurse application "iPhone Simulator" activate menu_click({"iPhone Simulator", "iOS Simulator", "Reset Content and Settings…"}) tell application "System Events" tell process "iPhone Simulator" tell window 1 click button "Reset" end tell end tell end tell SCRIPT </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload