Ignore a folder if it doesn't exist
This is the script i have been using as a part of a filing system.
If a folder doesn't exist I just need it to ignore the missing folder
How could I add an if exists within this script please?
Many Thanks in advance
Matt
tell application "Finder"
set theHotFolder to folder "Hal 9000:Users:matthew:Pictures:HotFolder2Do"
set allTheDestinationFolders to {¬
first folder of desktop whose name starts with "2_do_BHS", ¬
first folder of desktop whose name starts with "2_do_Bu", ¬
first folder of desktop whose name starts with "2_do_Da", ¬
first folder of desktop whose name starts with "2_do_Di", ¬
first folder of desktop whose name starts with "2_do_Do", ¬
first folder of desktop whose name starts with "2_do_In", ¬
first folder of desktop whose name starts with "2_do_Fr", ¬
first folder of desktop whose name starts with "2_do_No", ¬
first folder of desktop whose name starts with "2_do_Ma", ¬
first folder of desktop whose name starts with "2_do_Pr", ¬
first folder of desktop whose name starts with "2_do_To", ¬
first folder of desktop whose name starts with "2_do_Wa", ¬
first folder of desktop whose name starts with "2_do_Se"}
set allTheFilesToMove to {¬
files of theHotFolder whose name starts with ¬
"BH" or name starts with ¬
"SM" or name starts with ¬
"AL", ¬
files of theHotFolder whose name starts with ¬
"BU", ¬
files of theHotFolder whose name starts with ¬
"ES", ¬
files of theHotFolder whose name starts with ¬
"DV", ¬
files of theHotFolder whose name starts with ¬
"DJ" or name starts with ¬
"RA", ¬
files of theHotFolder whose name starts with ¬
"GT" or name starts with ¬
"CC", ¬
files of theHotFolder whose name starts with ¬
"FR", ¬
files of theHotFolder whose name starts with ¬
"TM17" or name starts with ¬
"NN", ¬
files of theHotFolder whose name starts with ¬
"MA" or name starts with ¬
"MF" or name starts with ¬
"FI" or name starts with ¬
"MC" or name starts with ¬
"MH" or name starts with ¬
"MB", ¬
files of theHotFolder whose name starts with ¬
"PR", ¬
files of theHotFolder whose name starts with ¬
"TM15" or name starts with ¬
"TM11", ¬
files of theHotFolder whose name starts with ¬
"WA", ¬
files of theHotFolder whose name starts with ¬
"SE"}
iMac, Mac OS X (10.6.8)