2015-01-10 20 views
0

我在我的MacBook Pro上的iTunes中有歌曲,我從一開始評價爲五星。當我在DJ軟件中打開歌曲時,它不會顯示評分,因爲iTunes不會將它們寫入ID3標籤,而只是將它保留在iTunes中。閱讀評分從ITunes,把它寫到文件

我已經想通了,我可以這樣做閱讀的評價:

tell application "iTunes" 
    set songRating to get rating of current track 
end tell 
return songRating 

另外,我可以通過這樣得到的位置:

tell application "iTunes" 
    set songLocation to get location of current track 
end tell 
return songLocation 

現在如何使用的文件路徑我必須將評分寫入文件的ID3標記中?

+1

抓鬥[誘變劑](https://pypi.python.org/pypi/mutagen)(蟒模塊)。它帶有'mid3v2'。從腳本到該程序進行系統調用,並使用它來修改'POPM'字段,注意[陷阱和不一致性](http://yabb.jriver.com/interact/index.php?topic=53283.0; wap2 )與該領域。 – hrbrmstr

回答

1

您可以將評論標籤設置爲評分,這應該在第三方應用程序中可讀。

例如,

tell application "iTunes" 

    set comment of the current track to "rating:" & (get rating of current track) 

end tell 

額定值是百分比值,即,2星級== 40.