AppleScript - move files to specific folders based on list of files and folders?, AppleScript - move files to specific folders based on list of files and folders?
I need to write an apple script/automator program that will help me sort files into folders based on lists.
So I have a list of around 60 folders and the names of over 1200 corresponding files that need to go into those 60 folders. I'm not sure the best way to approach this and don't care if it is the best I just need it to work. The file names have no distiquishing names so I must use the lists that I have to match the files with the correct folders.
I know this is basic programming but I cannot figure out how to get the corresponding items out of my lists to set varriables with them. What is the best format to start with? CSV? Text File?
Right now I have a CSV file where Column 1 is File Name and Column 2 is Folder Name
Here is what I have so far:
Automator - Get Contents of Text Edit Document - (CSV file) "Names"
AppleScript -
on run {input, parameters}
set X to X + 1
set tempTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to ("," & return)
set variable1 to text item X (where variable1 is file name and X is variable)
set X to X + 1
Set PathV2 to text item X (where PathV2 is subfolder name)
set AppleScript's text item delimiters to tempTID
return input
Automator - Find Finder Items "variable1"
Automator - Move Finder Items "PathV2"
Automator - Loop
Can anyone help my code? or write this better?
Automator-OTHER, Mac OS X (10.6.8)