(* Copyright (c) 2006 Jim Ursetto *)
(* Derived from scripts by Doug Adams (dougscripts.com) and
   from http://marv.kordix.com/archives/000860.html. *)

tell application "iTunes"
	if selection is not {} then
		set sel to a reference to selection
		(*		with timeout of 30000 seconds *)
		repeat with f in sel
			if f's class is file track then
				set fpath to (get f's location)
				if fpath is not missing value then
					set ppath to quoted form of POSIX path of fpath
					(* display dialog "path: " & ppath *)
					do shell script "touch " & ppath -- Refresh 
					refresh f -- Update file location
				end if
			end if -- skip if incorrect type of track
		end repeat
		(*		end timeout *)
	else
		display dialog "Nothing has been selected." buttons {"Cancel"} default button 1 with icon 0
	end if
end tell
