Apple Script based app doesn't work on MacOS 10.2

Hello,
I created Apple Script Application on Xcode and built it. It worked OK on MacOS 10.3 but it couldn’t be launched on 10.2.
Does anyone knows the fix for this?

Environment:
Xcode 1.2 running on MacOS 10.3 Japanese
test machine1(OK): PowerBook running MacOS10.3 Japanese
test machine2(NG): iBook running MacOS 10.2.7 Japanese

Steps:

  1. create an “Apple Script Application” Project on Xcode
  2. open “MainMenu.nib” with Interface Builder
  3. add a button, then ‘show Info’ and select Applescript property
  4. enable ‘clicked’ action and check the default applescript as target script file
  5. build the project
  6. launch the compiled app on test machine 1 and it work fine
  7. launch on test machine 2, the app couldn’t be launched and it displays ‘app quited for unknown reason…’ (I’m not sure what was the exact message)

thanks in advance,
masahiko[/b]

I really don’t know if this is the same thing or not.

I had previously developed an app in OS10.2.? ( I am not really sure what exact version of 10.2), but when I tried to use it on OS10.1.? ( I am not really sure what exact version of 10.1) I got the same error message you got.

The fix that I found was to replace the “main.m” file in my project with the “main.m” file that would be used for that version of the OS. This fixed my problem. I kept the older “main.m” in use the whole time, and the app worked fine on 10.2 and 10.1.

I do not run OS10.2.7 like you, but I do have 10.2.8. You can replace the contents of your “main.m” file (In Project builder, it is located in “Other Sources”) with this and give it a try (NO PROMISES). Just copy everything in between the $, but not the $.

$
#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);

}
$

Give it a try, but remember to back up you original project first!!![/b]