次を使用して歌詞を取得できます。
osascript -e '''tell application "iTunes" to lyrics of the current track'''
どうすれば設定できますか?
テキスト エディタを使用して、現在の歌詞を修正しようとしています。
次を使用して歌詞を取得できます。
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