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...
Step-by-Step Guide
-
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. -
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. -
Step 3: An assistant should open.
-
Step 4: Name your project.
-
Step 5: Double click "Talking_ExampleAppDelegate.applescript".
-
Step 6: Type: on clicked the object (say "hello") end clicked
-
Step 7: Then type Command+"B" to build.
-
Step 8: Now double click "MainMenu.xib".
-
Step 9: Drag a button from the palette
-
Step 10: double-click it
-
Step 11: and name it "Hello".
-
Step 12: open the attribute editor by going to "tools" on the menu bar
-
Step 13: and clicking the "attribute editor".
-
Step 14: See the dropdown menu that says "script"?
-
Step 15: Now click file > save.
-
Step 16: In Xcode
-
Step 17: press build and go at the top.
-
Step 18: Beginning with Snow Leopard
-
Step 19: Apple has deprecated the use of Applescript Studio
-
Step 20: but fear not
-
Step 21: in spite of a bit of extra typing
-
Step 22: things are actually better without it.
-
Step 23: File>New Project
-
Step 24: Click Applescript Application
-
Step 25: Name your project
-
Step 26: this example is named "Talking Example"
-
Step 27: Your project should appear
-
Step 28: Double click "Talking_ExampleAppDelegate.applescript"
-
Step 29: There are already some items filled in for you.
-
Step 30: Type Cmd+B to build
-
Step 31: Now double-click MainMenu.xib
-
Step 32: Interface builder should open.
-
Step 33: A blank window should appear and you can drag a button onto it from the Library.
-
Step 34: Double click the button and make it "Hello"
-
Step 35: CTRL-drag from the Hello button to the blue cube called "Talking Example AppDelegate" and let go.
-
Step 36: Now click file > save.
-
Step 37: In Xcode
-
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
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.
Rate This Guide
How helpful was this guide? Click to rate: