09/04/02 22:32:26 ZHi3hY6w0
>>132
名前が同じトラックのプレイリストを作るAppleScript。iTunes7.6.2でテスト。
スクリプトエディタで実行する場合はイベントログは記録しない方が速い。
tell application "iTunes"
set allTrackName to name of every track of playlist 1
set checkedNameList to {}
set dupNameList to {}
repeat with theNameItem in allTrackName
set theName to contents of theNameItem
if checkedNameList contains theName then
if dupNameList does not contain theName then
set end of dupNameList to theName
end if
else
set end of checkedNameList to theName
end if
end repeat
log dupNameList
repeat with theNameItem in dupNameList
try
set theName to contents of theNameItem
set thePlaylist to make new playlist with properties {name:"dup-" & theName}
duplicate (every track of playlist 1 whose name is theName) to thePlaylist
on error msg
log "error:" & msg
end try
end repeat
end tell