Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A better way to activate menu items from AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A better way to activate menu items from AppleScript
Authored by: leenoble_uk on Apr 19, '09 10:01:14AM

You've probably figured this out already as it's been some time since your post. But anyway...

I keep all my common code in a file called Common code.scpt and keep it in my Library/Scripts folder.

(*
PUT THE FOLLOWING LINE AT THE TOP OF ANY SCRIPT YOU LIKE
set commonScript to load script alias ((path to library folder from user domain as string) & "Scripts:Common code.scpt")

AND THEN USE THIS LINE TO CLICK A MENU ITEM
menu_click("Finder", "View", "...", "...") of commonScript
*)


---
Brought to you by S C Johnson, a family multinational conglomerate.



[ Reply to This | # ]
A better way to activate menu items from AppleScript
Authored by: jonswar on Oct 09, '09 09:34:03AM

I love this function, but the following

menu_click({"Mail", "Message", "Move To", "Keep"})

Takes 4-10 seconds to execute on my mac. Other applescripts generally execute quickly. Any idea how to profile this to determine what's taking the time? I would love to use this and not struggle through menu expressions as before!



[ Reply to This | # ]