-1

拡張機能ではなく、アプリケーションを開発したい。ただし、アプリケーションは iTunes を制御し、iTunes から歌詞などの音楽の情報を取得する権利を持っています (SuperTunes に似ています)。関連するテンプレートやガイダンスはどこで入手できますか? ありがとう。

4

1 に答える 1

1

iTunes の制御に関しては、ネイティブの cocoa API はありませんが、次を使用してアプリから実行できる AppleScript を使用できます。

NSString* path = [[NSBundle mainBundle] pathForResource:@"ScriptName" ofType:@"scpt"];
NSURL* url = [NSURL fileURLWithPath:path];NSDictionary* errors = [NSDictionary dictionary];
NSAppleScript* appleScript = [[NSAppleScript alloc] initWithContentsOfURL:url error:&errors];
[appleScript executeAndReturnError:nil];

使用できる AppleScript コマンドの良い例は、http: //dougscripts.com/itunes/itinfo/info03.phpにあります。

于 2012-12-21T08:33:11.140 に答える