Skip to content

Tell a Button to Trigger a Menu

One of the first things I went poking around for on MacScripter forums was simply how to get a button to trigger a menu. I was looking for a simple “do menu item” kind of command. I don’t remember where I found it but this was apparently all I needed to do is activate the click handler for the button and assign it the correct script in Interface Builder and then add a script such as the one below:

on clicked theObject
    if the name of theObject is "doMenuItem" then
	   tell menu item "menuItemName" of menu "menuFile" of main menu to perform action
    end if
end clicked