我從http://www.dougscripts.com/itunes/得到了提示,想出下面的代碼。但它需要更多的改進。從itune中讀取歌詞來製作一個文件
- 當我完成文件生成時,出現錯誤,http://a.imageshack.us/img831/1610/screenshot20100804at113l.png,出了什麼問題?
- 我不需要使用「文本編輯」來存儲文件,有沒有更好的方法只是將信息存儲到文件?
tell application "iTunes" if player state is playing then set sel to current track as list else if selection is not {} then set sel to selection end if set noSong to "" set summaryFile to ((path to desktop as Unicode text) & "songs2.txt") set ff to open for access file summaryFile with write permission repeat with this_track in sel set the_lyrics to this_track's lyrics set {art, nom} to {this_track's artist, this_track's name} if the_lyrics is not "" then tell application "TextEdit" activate set myVar to art & nom & the_lyrics write myVar to ff starting at eof end tell else beep end if end repeat end tell
謝謝你的腳本,WriteToLog()應該已經WRITELOG(),如果沒有它,它工作正常。 – prosseek 2010-08-05 18:55:43
哎呀!固定。感謝您的支持。 – 2010-08-05 19:33:14