Objective c iTunes可以';t设置洗牌模式

Objective c iTunes可以';t设置洗牌模式,objective-c,cocoa,scripting-bridge,Objective C,Cocoa,Scripting Bridge,我正在使用脚本bride将我的mac应用程序连接到iTunes。我尝试设置shuffle属性,但它不会改变 iTunesApplication *itunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.itunes"]; itunes.currentPlaylist.shuffle = YES; NSLog([NSString stringWithFormat:@"%hhd", itunes.currentPlayl

我正在使用脚本bride将我的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属性

编辑:我已经用

sdef /Applications/iTunes.app | sdp -fh --basename iTunes

还是没有运气。

经过一点调查,我发现我不是唯一一个有这个问题的人。这是iTunes中的一个bug。我还提交了一份bug报告,并鼓励您也这样做

只是一个想法。。。虽然无法打开/关闭iTunes/Music shuffle,但可以播放随机曲目:[[self.MusicApp.currentPlaylist.tracks对象索引:arc4random()%self.MusicApp.currentPlaylist.tracks.count]播放一次:是];