The purpose of this Script is to sort TV shows into Folders of the same name. I have to use the first word of the file name to identify the TV show. That part works great. The script is unable to identify the destination folder with the same name. I've racked my brain and googled the world to solve this but have come up with nothing. If any one can help I would very much appreciate it.
The problem I'm having is on this line:
See what happens:
Full Script:
The problem I'm having is on this line:
Code:
move selection to folder whose name begins with theCurrentValue of disk "tv"
See what happens:
get some file of disk "tv" whose name starts with "Psych"
document file "Psych.S03E13.HDTV.XviD-aAF.avi" of disk "tv"
exists document file "Psych.S03E13.HDTV.XviD-aAF.avi" of disk "tv"
true
select every file of disk "tv" whose name starts with "Psych"
{document file "Psych.S03E13.HDTV.XviD-aAF.avi" of disk "tv", document file "Psych.S03E14.HDTV.XviD-aAF.avi" of disk "tv", document file "Psych.S03E15.HDTV.XviD-aAF.avi" of disk "tv"}
"Cant get folder whose name starts with theCurrentValue of disk \"tv\"."
Full Script:
Code:
set tvShowFirstWordOfFileName to {"Heroes", "Psych", "Battlestar", "Lost", "Ghost", "Monk", "The", "How", "Smallville"}
tell application "Finder"
repeat with theCurrentValue in tvShowFirstWordOfFileName
set testFile to {}
try
set testFile to (some file of disk "tv" whose name begins with theCurrentValue)
end try
if exists testFile then
select (every file of disk "tv" whose name begins with theCurrentValue)
move selection to folder whose name begins with theCurrentValue of disk "tv"
end if
end repeat
end tell