How to Make a Simple Program With Xcode
Method 1 of 1:
Snow Leopard and Later
- Beginning with Snow Leopard, Apple has deprecated the use of Applescript Studio, but fear not, in spite of a bit of extra typing, things are actually better without it. Go ahead and grab Xcode 3.2.5 or later. You can get 4.0 in the Mac App Store for free.
- File>New Project
- Click Applescript Application
- Name your project, this example is named "Talking Example"
- Your project should appear
- Double click "Talking_ExampleAppDelegate.applescript"
- There are already some items filled in for you. After the property declaration, insert a new handler:
- on clickedme_(sender)
- say "hello"
- end clickedme_
- Type Cmd+B to build
- Now double-click MainMenu.xib
- Interface builder should open. Close any xib windows it brings up from previous projects you may have worked on.
- A blank window should appear and you can drag a button onto it from the Library.
- Double click the button and make it "Hello"
- CTRL-drag from the Hello button to the blue cube called "Talking Example AppDelegate" and let go. You can now pick the clicked-me event handler to link to the "Hello" button you just made.
- Now click file > save. You many now quit interface builder.
- In Xcode, press build and go at the top. Your application should run smoothly.
4 ★ | 2 Vote