How to Make a Simple Program With Xcode

Open Xcode., Click File>new project. , An assistant should open., Name your project., Double click "Talking_ExampleAppDelegate.applescript". , Type: on clicked the object (say "hello") end clicked , Then type Command+"B" to build. , Now double click...

38 Steps 2 min read Advanced

Step-by-Step Guide

  1. Step 1: Open Xcode.

    You may not have Xcode on your system, in that case, install it with the developer tools CD that should have come with your computer. ,, click "Applescript Application". , In this example, it is named "Talking Example".

    Your project should appear. ,,,, Interface builder should open.

    A window should appear. ,, Then, at the top of the attribute editor, you should see a little white scroll.

    Click it.

    QUICK CHECK does your screen look like this? , (blue circle) choose "talking example.applescript".

    Now, see the checkbox that says "action"

    and under it "clicked"? (red circle) check "clicked".

    This will make it so that when you click the button, talking example.applescript will activate, thus making it say "hello". , You may now quit interface builder. , Your application should run smoothly. , Go ahead and grab Xcode
    3.2.5 or later.

    You can get
    4.0 in the Mac App Store for free.
  2. Step 2: Click File>new project.

    ,,,,, After the property declaration, insert a new handler: on clickedme_(sender) say "hello" end clickedme_ ,,, Close any xib windows it brings up from previous projects you may have worked on. ,,, You can now pick the clicked-me event handler to link to the "Hello" button you just made. , You many now quit interface builder. , Your application should run smoothly.
  3. Step 3: An assistant should open.

  4. Step 4: Name your project.

  5. Step 5: Double click "Talking_ExampleAppDelegate.applescript".

  6. Step 6: Type: on clicked the object (say "hello") end clicked

  7. Step 7: Then type Command+"B" to build.

  8. Step 8: Now double click "MainMenu.xib".

  9. Step 9: Drag a button from the palette

  10. Step 10: double-click it

  11. Step 11: and name it "Hello".

  12. Step 12: open the attribute editor by going to "tools" on the menu bar

  13. Step 13: and clicking the "attribute editor".

  14. Step 14: See the dropdown menu that says "script"?

  15. Step 15: Now click file > save.

  16. Step 16: In Xcode

  17. Step 17: press build and go at the top.

  18. Step 18: Beginning with Snow Leopard

  19. Step 19: Apple has deprecated the use of Applescript Studio

  20. Step 20: but fear not

  21. Step 21: in spite of a bit of extra typing

  22. Step 22: things are actually better without it.

  23. Step 23: File>New Project

  24. Step 24: Click Applescript Application

  25. Step 25: Name your project

  26. Step 26: this example is named "Talking Example"

  27. Step 27: Your project should appear

  28. Step 28: Double click "Talking_ExampleAppDelegate.applescript"

  29. Step 29: There are already some items filled in for you.

  30. Step 30: Type Cmd+B to build

  31. Step 31: Now double-click MainMenu.xib

  32. Step 32: Interface builder should open.

  33. Step 33: A blank window should appear and you can drag a button onto it from the Library.

  34. Step 34: Double click the button and make it "Hello"

  35. Step 35: CTRL-drag from the Hello button to the blue cube called "Talking Example AppDelegate" and let go.

  36. Step 36: Now click file > save.

  37. Step 37: In Xcode

  38. Step 38: press build and go at the top.

Detailed Guide

You may not have Xcode on your system, in that case, install it with the developer tools CD that should have come with your computer. ,, click "Applescript Application". , In this example, it is named "Talking Example".

Your project should appear. ,,,, Interface builder should open.

A window should appear. ,, Then, at the top of the attribute editor, you should see a little white scroll.

Click it.

QUICK CHECK does your screen look like this? , (blue circle) choose "talking example.applescript".

Now, see the checkbox that says "action"

and under it "clicked"? (red circle) check "clicked".

This will make it so that when you click the button, talking example.applescript will activate, thus making it say "hello". , You may now quit interface builder. , Your application should run smoothly. , Go ahead and grab Xcode
3.2.5 or later.

You can get
4.0 in the Mac App Store for free.

,,,,, After the property declaration, insert a new handler: on clickedme_(sender) say "hello" end clickedme_ ,,, Close any xib windows it brings up from previous projects you may have worked on. ,,, You can now pick the clicked-me event handler to link to the "Hello" button you just made. , You many now quit interface builder. , Your application should run smoothly.

About the Author

K

Kevin Diaz

With a background in technology and innovation, Kevin Diaz brings 11 years of hands-on experience to every article. Kevin believes in making complex topics accessible to everyone.

74 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: