Skip to content

Responding to a Clicked Button

More basics. After you create an button in Interface Builder, in the last tab of the inspector give it a name, select the applescript in your project where you will be adding the script for the button, and then give it an event handler by checking Action: Clicked in the list of possible Event Handlers listed below.

Then go back to your script and you can begin scripting the button in XCode. For example:

on clicked theObject
	if the name of theObject is "myButton" then
		display dialog "You pushed a button."
	end if
end clicked

One Comment

  1. Killian wrote:

    …Interface Builder?

    Friday, September 26, 2008 at 5:59 pm | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*