1
我可以用得到的歌詞:如何從終端編輯iTunes歌曲歌詞?
osascript -e '''tell application "iTunes" to lyrics of the current track'''
但我該如何設置呢?
我正在嘗試使用我的文本編輯器更正當前的歌詞。
我可以用得到的歌詞:如何從終端編輯iTunes歌曲歌詞?
osascript -e '''tell application "iTunes" to lyrics of the current track'''
但我該如何設置呢?
我正在嘗試使用我的文本編輯器更正當前的歌詞。
osascript -e 'tell application "iTunes" to set lyrics of current track to "hoho"'
由於regulus6633
而作爲一個CLI腳本
#!/usr/bin/env osascript
-- update_lyrics <track persisten ID> <lyric file>
on run argv
try
set trackPersistentID to item 1 of argv
set lyricsFile to item 2 of argv
-- use awk to strip leading empty lines
set cmdString to "cat " & lyricsFile & " | awk 'p;/^#+$/{p=1}'"
set newLyrics to do shell script cmdString
on error
return "update_lyrics <trackID> <lyricsFile>"
end try
tell application "iTunes"
set mainLibrary to library playlist 1
try
set foundTrack to (first file track of mainLibrary whose persistent ID = trackPersistentID)
set lyrics of foundTrack to newLyrics
on error err_mess
log err_mess
end try
end tell
end run
很高興你能工作! – regulus6633 2012-08-05 12:51:51
您是否嘗試過 「歌詞設置」?我認爲就是這樣。 – regulus6633 2012-08-05 12:39:56