Newly created AppleScript Studio applications built using AppleScript Studio 1.2 templates in Mac OS X 10.2 won't work on earlier versions of Mac OS X.
Solution
The function call ASKInitialize in main.m, is only present in the Mac OS X 10.2 version of AppleScriptKit, so AppleScript Studio applications won't work on earlier versions of Mac OS X. A new version of main.m is provided below. Use this version to replace the contents of your existing main.m file. This changed versions of main.m checks for the existence of the function, then conditionally calls the ASKInitalize function.
main.m is normally located in the Other Sources folder, from the Files view of your project in Project Builder.
2. Replace the contents of main.m in the Project Templates folder, so all new projects created use the new version of main.m.
Project Builder uses the templates when creating new projects.
Location of main.m
You can find the main.m files in the following directories:
/Developer/ProjectBuilder Extras/Project Templates/Application/AppleScript Application
/Developer/ProjectBuilder Extras/Project Templates/Application/AppleScript Document-based Application
/Developer/ProjectBuilder Extras/Project Templates/Application/AppleScript Droplet
main.m will be changed in the next release of the developer tools.
main.m (new modified version)
#import <mach-o/dyld.h>
extern int NSApplicationMain(int argc, const char *argv[]);
int main(int argc, const char *argv[])
{
if (NSIsSymbolNameDefined("_ASKInitialize"))
{
NSSymbol *symbol = NSLookupAndBindSymbol("_ASKInitialize");
if (symbol)
{
void (*initializeASKFunc)(void) = NSAddressOfSymbol(symbol);
if (initializeASKFunc)
{
initializeASKFunc();
}
}
}
return NSApplicationMain(argc, argv);
}
Note: This software code is considered an upgrade and its use is governed by the terms of the original license agreement.