iTunesを使いこなそう!for Mac Part 69at MACiTunesを使いこなそう!for Mac Part 69 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト620:名称未設定 09/04/28 08:01:45 nNi3++Fz0 この作業で厄介なのは、別ライブラリのXMLをパースして、 さらに楽曲ごとに照らし合わせをしなくちゃならないこと。 再生回数の足し引きくらいなら誰でも出来るけど、ちょっと勉強したくらいじゃ難しいと思う。 621:名称未設定 09/04/28 08:10:37 MkOefkQtP >>620 >>618へのレスですよね そっか、そう言えばそうでした ごめん、やっぱ諦めた方がイイかも>>617 622:名称未設定 09/04/28 11:50:58 OiCUS6iK0 ちゃんとパースする気なんかなかったけど。とりあえず手抜きで良いじゃんw set theXML to "~/Desktop/'iTunes Music Library.xml'" set tempFile to "~/Desktop/TempFile.txt" do shell script "grep -E '<key>(Name|Artist|Album|Play (Count|Date UTC))</key>' " & theXML & " | perl -pe 'tr /\\t\\n//d; s,(<key>Name</key>),\\n$1,g; s,(\\d+);,chr $1,eg' >" & tempFile tell application "iTunes" set theTracks to selection of front browser window repeat with aTrack in theTracks tell aTrack set theKey to "<key>Name</key><string>" & name & "</string><key>Artist</key><string>" & artist & "</string><key>Album</key><string>" & album & "</string>" try set theDelta to do shell script "grep " & quoted form of theKey & " " & tempFile & " | sed 1q | perl -pe 's,.*<key>Play Count</key><integer>(\\d+)</integer>.*,$1,'" set oldCount to played count set newCount to oldCount + theDelta set played count to newCount my ConsoleLog("new play count: " & newCount & " (was " & oldCount & ") for " & theKey) on error my ConsoleLog("can't find play count for: " & theKey) end try end tell end repeat end tell on ConsoleLog(theLog) do shell script "echo >/dev/console \"`date '+%b %e %H:%M:%S'`\" " & quoted form of theLog end ConsoleLog 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch