--get date in proper form do shell script "date "+%Y-%m%d"" set datef to the result --create name for file set NewFileName to "desired location for temp file.m3u" --write properly formatted contents of .m3u file do shell script "echo http://www.archive.org/download/dn" & datef & "/dn" & datef & "-1_64kb.mp3 > " & NewFileName tell application "iTunes" --get list of outdated URL tracks tell source "Library" tell playlist "Library" set these_tracks to (every URL track whose name ends with " Democracy Now Stream") end tell end tell --delete these tracks repeat with this_track in these_tracks delete this_track end repeat --add new file to library add (POSIX file NewFileName as alias) --change track name set name of result to (datef & " Democracy Now Stream") end tell --delete the m3u file do shell script "rm " & NewFileName