I am wanting the end result of this applescript to be where I can drag and drop a folder on it with miscellaneous files inside (.doc, .ppt, .xls, .pdf, .mp3, .jpeg, .jpg, .bmp, etc.) and for them to automatically sort into its appropriate location on the computer. Picture files would move to the user’s pictures folder, music would move to the user’s music folder, and document files would move to the user’s documents folder. This script needs to be universal to where it can work on an unlimited amount of computers. I’m somewhat new to applescript but I just can’t figure this one out on my own. I may be way off track, but here is what I’ve put together so far.
on adding folder items to this_folder after receiving added_items
repeat with item_ in added_items
tell application "Finder"
set theFolder to path to documents folder from user domain
end tell
tell application "Finder"
try
if name extension of item_ is "doc" then
move item_ to theFolder with replacing
else
if name extension of item_ is "txt" then
move item_ to theFolder with replacing
end if
end if
end try
end tell
end repeat
end adding folder items to