我想在applescript的可可应用程序中调用一个IBAction:
我想打个电话:
- (IBAction)reverse:(id)pId;
{
direction = -1;
} 在外部applescript文件中包含一行代码,如:
tell application "theapp"
reverse
end tell有什么想法吗?
提前感谢
发布于 2011-11-13 21:27:49
使用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也有一个很好的答案
https://stackoverflow.com/questions/8111809
复制相似问题