tell application "Finder" set myDesktop to alias ((path to desktop folder as text)) -- folders to sort into set myMusic to alias ((path to desktop folder as text) & "Music") set myPrograms to alias ((path to desktop folder as text) & "Programs") set myPics to alias ((path to desktop folder as text) & "Pics") set myTorrents to alias ((path to desktop folder as text) & "Torrents") set myVideos to alias ((path to desktop folder as text) & "Video") set myDocs to alias ((path to desktop folder as text) & "Documents") --extension lists set musicExt to {".mp3", ".aac"} set programsExt to {".dmg", ".sit", ".app"} set picsExt to {".jpg", ".gif", ".tif", ".png", ".psd"} set torrentsExt to {".torrent"} set videosExt to {".avi", ".mpg", ".mov"} set docsExt to {".pdf", ".txt", ".doc", ".xls", ".sav", ".key", ".pages", ".jmp"} set allFiles to files of myDesktop repeat with theFile in allFiles copy name of theFile as string to FileName repeat with ext in musicExt if FileName ends with ext then move theFile to myMusic end if end repeat repeat with ext in programsExt if FileName ends with ext then move theFile to myPrograms end if end repeat repeat with ext in picsExt if FileName ends with ext then move theFile to myPics end if end repeat repeat with ext in torrentsExt if FileName ends with ext then move theFile to myTorrents end if end repeat repeat with ext in docsExt if FileName ends with ext then move theFile to myDocs end if end repeat repeat with ext in videosExt if FileName ends with ext then move theFile to myVideos end if end repeat end repeat end tell