NSAppleScriptから戻り値を取得するにはどうすればよいですか。私はアップルスクリプトを使用してiTunesで曲のタイトルを取得し、その値を取得してNSMenuItemのタイトルを設定しています。
私のコード:.M
//run applescript
NSAppleScript *script = [[NSAppleScript alloc] initWithSource:@"tell application \"iTunes\" to set song to name of current track"];
[script executeAndReturnError:nil];
//set menu item title
[songName setTitle:script];
私のコード:.H
IBOutlet NSMenuItem *songName;