我想在AppleScript的cocoa app中调用IBAction:
我想打电话:
- (IBAction)reverse:(id)pId;
{
direction = -1;
}
在外部AppleScript文件中添加一行,如:
tell application "theapp"
reverse
end tell
任何想法?
先谢谢
答案 0 :(得分:1)
使用NSAppleScript。
NSAppleScript *as = [[NSAppleScript alloc] initWithSource:@"tell application \"theapp\"\nreverse\nend tell"];
NSDictionary *err = nil;
NSAppleEventDescriptor *desc = [as executeAndReturnError:&err];
NSLog(@"Error: %@\nData: %@", err, desc.data);
[as release];
Scripting Bridge
here