newtab 596 B

1234567891011121314151617181920212223242526
  1. savepath
  2. osascript >/dev/null <<EOF
  3. on do_submenu(app_name, menu_name, menu_item, submenu_item)
  4. -- bring the target application to the front
  5. tell application app_name
  6. activate
  7. end tell
  8. tell application "System Events"
  9. tell process app_name
  10. tell menu bar 1
  11. tell menu bar item menu_name
  12. tell menu menu_name
  13. tell menu item menu_item
  14. tell menu menu_item
  15. click menu item submenu_item
  16. end tell
  17. end tell
  18. end tell
  19. end tell
  20. end tell
  21. end tell
  22. end tell
  23. end do_submenu
  24. do_submenu("Terminal", "Shell", "New Tab", 1)
  25. EOF