adding a new applescript?


when I create a new app, xcode opens up and in the Classes folder their is
a script, called TESTAppDelegate.applescript, my question is how do I create
another applescript to go into this folder to be used in my project?


In the sidebar, right click on the folder “Classes.” Then click “Add”> “New File.” And select Applescript File from “Cocoa classes”

cheers Dylan would have taken ages to locate that.

in my other applescript it has TESTAppDelegate.applescript, the new one is called TEST2, does this matter?

do I use this applescript the same as my other applescript and bind to this other buttons etc etc or is their
other set up processes I need to do to use it?

The only time the name of a class file matters is if you want to connect it to a class in IB (Interface Builder), which is what you do. A better way to do this would be:

  1. Create a new class in IB by dragging Mr.Blue Box into your project: Image

  2. Name the class in the Inspector: Image

    1. Go into classes. 2. Search for the class (EX “TEST2”) 3. Click on what is there in your project and add “NSObject”: Image
  3. Click on “Generate Class files” and follow the instructions (it’s just a save and OK): Image

Congratulations: you have class files and a class in your project: Image

Delete the file you have before you started this so you have a fresh page to add the files to. Reply if you need help.

thank you sir, great stuff, being a novice this information is extremely valuable, i’m sure others will benefit from
this also.

You can also use File → New File.