So I have a pure Cocoa app, and need to add Applescript functionality to a button. (At this point it’s really just a test app to check for functionality.) I’ll be looking into AscriptObjC soon, but not for this app.
I added the ApplescriptKit.Framework into the frameworks folder, added the AS compile build steps.
My question is, in the main.m file, what is needed, truly?
Here’s the main.m for an Applescript app:
extern void ASKInitialize();
extern int NSApplicationMain(int argc, const char *argv[]);
int main(int argc, const char *argv[])
{
ASKInitialize();
return NSApplicationMain(argc, argv);
}
and here’s the main.m for a cocoa file:
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **) argv);
}
If I remove the 2 lines referencing ASK from the Applescript (test) app, it seems to work OK. If I add them to the cocoa app, it works OK with or without them. So, are they necessary at all?