trouble moving files from Downloads to various folders

I download several files everyday and need a way to automatically move them from downloads folder to other folders. Any help as to why this doesn’t work would be appreciated

set FileName to “Macintosh HD:Users:macbook:Downloads:”

tell application “Finder”
if name of FileName starts with “Can” then
move file FileName to folder “Macintosh HD:Users:macbook:Desktop:bid downloads:Canslim:Canslim 2014:”

else if name of FileName starts with "IBD 50" then
	move file FileName to folder "Macintosh HD:Users:macbook:Desktop:bid downloads:IBD 50:IBD 50 2014:"
	
else if name of FileName starts with "international" then
	move file FileName to folder "Macintosh HD:Users:macbook:Desktop:bid downloads:International:International 2014:"
	
else if name of FileName starts with "Sector" then
	move file FileName to folder "Macintosh HD:Users:macbook:Desktop:bid downloads:Sector:Sector 2014:"
	
else if name of FileName starts with "Stocks" then
	move file FileName to folder "Macintosh HD:Users:macbook:Desktop:bid downloads:SOTM:SOTM 2014:

"
else if name of FileName starts with “Internet” then
move file FileName to folder "Macintosh HD:Users:macbook:Desktop:bid downloads:Tech:Tech 2014:
"

end if

end tell
return input
end run

Browser: Safari 534.57.7
Operating System: Mac OS X (10.8)

Hi,

you have to get the files of the download folder and process each file in a repeat loop


set downloadsFolder to path to downloads folder
set bidDownloadsFolder to (path to desktop as text) & "bid downloads:"

tell application "Finder"
	set theFiles to files of downloadsFolder
	repeat with aFile in theFiles
		set FileName to name of aFile
		if FileName starts with "Can" then
			move aFile to folder (bidDownloadsFolder & "Canslim:Canslim 2014:")
			
		else if FileName starts with "IBD 50" then
			move aFile to folder (bidDownloadsFolder & "IBD 50:IBD 50 2014:")
			
		else if FileName starts with "international" then
			move aFile to folder (bidDownloadsFolder & "International:International 2014:")
			
		else if FileName starts with "Sector" then
			move faFile to folder (bidDownloadsFolder & "Sector:Sector 2014:")
			
		else if FileName starts with "Stocks" then
			move aFile to folder (bidDownloadsFolder & "SOTM:SOTM 2014:")
			
		else if FileName starts with "Internet" then
			move aFile to folder (bidDownloadsFolder & "Tech:Tech 2014:")
		end if
		
	end repeat
end tell

Stefan,

Awesome! thanks for the help!!!