/ Published in: AppleScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
-- brandonjp 201103211103 -- applescript function to check if a menu item exists, if so click on it, then cmd+tab back to previous app menuItemClick({"timeEdition", "Extras", "Start Recording"}) on menuItemClick({appName, menuName1, menuItem1}) tell application "System Events" tell application process appName if menu item menuItem1 of menu 1 of menu bar item menuName1 of menu bar 1 exists then set frontmost to true click menu item menuItem1 of menu 1 of menu bar item menuName1 of menu bar 1 keystroke tab using {command down} else return false end if end tell end tell end menuItemClick