title: Execute Menu Item Shortcuts from Terminal
body: <p>Is there a way to write a bash script that opens a program and then executes a menu shortcut of the program?</p>
  
  <p>For example,</p>
  
  <p>open XCode project -> Command + R to run</p>
  
  <p>open Chrome -> Command + N for new window</p>
  
  <p>I thought it might look something like:</p>
  
  <p><code>$ open MyProject.xcodeproj | exec ⌘ r</code></p>