I want to be able to load and run another applescript from the AppDelegate.applescript. So a couple questions. First off, should the file be put as .applescript or .scpt. Also, how do I go about loading and running it? I know you would usually use something like (path to resource) but how can I get it to load and run inside Xcode? So how the files are setup in the end-all application will be different than how they are set up in the Xcode project. Right now the second script file is right under the appDelegate file in the same folder. Which is [Name of App]/[Name of App]/ ___.scpt
If you want to load and run as in normal AS, save it as a .scpt and put it inside another folder, so it doesn’t end up loose in Resources. Then use load script as normal.
If you want to load it as a separate AS-based class, save it as .applescript in Resources, and call it as if it’s a Cocoa class.
Sorry I am very new to Xcode and everything. OK so in Xcode where would I create the new folder? Right now in the file hierarchy it has the project name, then a folder with project name, then the appDelegate and main.xib and supporting files folder. Would I make this folder under the project name folder? Also, what would be the exact (path to ) command or the like to access the files in there? I would think something with path to me but am not sure. I have been looking online for quite a while but nothing has working for me.
On an unrelated note, right now I am at a roadblock in the program because every time I run it it throws an error in the main.m file that there is an error thread 1: exc_bad_access code=1, address=(this changes every time). Any ideas on a fix? I am running yosemite 10.10 and doing all of this in Xcode 6 beta, so idk if that could be the source of it. It was running perfectly fine for several days though, and it ran fine using the exact same code it has now (I didn’t change anything, it just started throwing that error). Thanks in advance.
Everyone has to start somewhere. But your problem is you’re trying to run without bothering to learn to walk. You need to get the basics down, and starting with beta tools under a beta OS is really not the best way to do that.
So create a file in the Finder called, say, Scripts. Put your .scpt files in it. Then drag it into the Project Navigator area of your project.
But until you find what’s causing your exc_bad_access error, you’re not going to get far.