How to Make a Simple Program With Xcode

Method 1 of 1:

Snow Leopard and Later

  1. How to Make a Simple Program With Xcode Picture 1
    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.
  2. How to Make a Simple Program With Xcode Picture 2
    File>New Project
  3. How to Make a Simple Program With Xcode Picture 3
    Click Applescript Application
  4. How to Make a Simple Program With Xcode Picture 4
    Name your project, this example is named "Talking Example"
  5. How to Make a Simple Program With Xcode Picture 5
    Your project should appear
  6. How to Make a Simple Program With Xcode Picture 6
    Double click "Talking_ExampleAppDelegate.applescript"
  7. How to Make a Simple Program With Xcode Picture 7
    There are already some items filled in for you. After the property declaration, insert a new handler:
    1. on clickedme_(sender)
    2. say "hello"
    3. end clickedme_
  8. How to Make a Simple Program With Xcode Picture 8
    Type Cmd+B to build
  9. How to Make a Simple Program With Xcode Picture 9
    Now double-click MainMenu.xib
  10. How to Make a Simple Program With Xcode Picture 10
    Interface builder should open. Close any xib windows it brings up from previous projects you may have worked on.
  11. How to Make a Simple Program With Xcode Picture 11
    A blank window should appear and you can drag a button onto it from the Library.
  12. How to Make a Simple Program With Xcode Picture 12
    Double click the button and make it "Hello"
  13. How to Make a Simple Program With Xcode Picture 13
    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.
  14. How to Make a Simple Program With Xcode Picture 14
    Now click file > save. You many now quit interface builder.
  15. How to Make a Simple Program With Xcode Picture 15
    In Xcode, press build and go at the top. Your application should run smoothly.
4 ★ | 2 Vote