2012-08-05 8 views
1

나는 사용하여 가사를 얻을 수 있나요?iTunes에서 노래 가사를 어떻게 편집 할 수 있습니까?</p> <pre><code>osascript -e '''tell application "iTunes" to lyrics of the current track''' </code></pre> <p>을하지만 어떻게 내가 그들을 설정할 수 있습니다

텍스트 편집기를 사용하여 현재 가사를 수정하려고합니다.

+1

는 "가사를 설정"시도하셨습니까 CLI 스크립트로? 나는 그것이라고 생각한다. – regulus6633

답변

2
osascript -e 'tell application "iTunes" to set lyrics of current track to "hoho"' 

감사

을 regulus6633 그리고

#!/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 
+1

다행 이군! – regulus6633