【问题标题】:iTunes can't set shuffle modeiTunes 无法设置随机播放模式
【发布时间】:2013-07-26 14:08:04
【问题描述】:

我正在使用脚本新娘将我的 mac 应用程序连接到 iTunes。我尝试设置 shuffle 属性,但它不会改变。

iTunesApplication *itunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.itunes"];
itunes.currentPlaylist.shuffle = YES;
NSLog([NSString stringWithFormat:@"%hhd", itunes.currentPlaylist.shuffle]);

NSLog 将始终打印 0,即使我在 iTunes 中手动更改随机播放模式。我在设置重复模式时遇到同样的问题

itunes.currentPlaylist.songRepeat = iTunesERptAll; // Has no effect

另一方面,我可以毫无问题地改变音量

itunes.soundVolume += 20;

这里发生了什么?难道是我必须通过 currentPlaylist 属性?

编辑:我已经用

更新了我的 iTunes.h 文件
sdef /Applications/iTunes.app | sdp -fh --basename iTunes

仍然没有运气。

【问题讨论】:

    标签: objective-c cocoa scripting-bridge


    【解决方案1】:

    经过一番研究,我了解到我不是唯一遇到此问题的人。这是iTunes中的一个错误。我还提交了错误报告,并鼓励您这样做!

    【讨论】:

    • 只是一个想法...虽然您无法打开/关闭 iTunes/Music shuffle,但您可以播放随机曲目:[[self.MusicApp.currentPlaylist.tracks objectAtIndex:arc4random() % self.MusicApp.currentPlaylist.tracks.count] playOnce:YES];
    猜你喜欢
    • 2013-01-18
    • 1970-01-01
    • 2012-12-16
    • 2020-11-25
    • 1970-01-01
    • 2015-04-29
    • 2023-01-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多