0
myHandler()
を主な機能に呼び出すことはできますか?私の考えは、最初は自動的にハンドラを呼び出すことです。 THXmain関数でハンドラを呼び出すことはできますか?
main.m:
#import <Cocoa/Cocoa.h>
#import <AppleScriptObjC/AppleScriptObjC.h>
int main(int argc, const char * argv[]) {
[[NSBundle mainBundle] loadAppleScriptObjectiveCScripts];
return NSApplicationMain(argc, argv);
}
AppDelegate.applescript:
script AppDelegate
on myHandler()
say "Welcome,sir."
end myHandler
on applicationWillFinishLaunching_(sender)
-- Insert code here to initialize your application before any files are opened
end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
end script
@Novice私は自分の提案がどのようにうまくいっているか知りたいです。 – wch1zpink