Continue on error

Guys

i have the script…

do shell script “mv ~/Downloads/.dmg ~/Downloads/Images"
do shell script "mv ~/Downloads/
.sit ~/Downloads/Images”

but if there are no *.dmg files in ~/Downloads, it will not go on and move the *.sit 's.
How could one avoid this problem

regards

Hi,

use a try block for each statement.
If an error occurs within a try block, the script continues after the end try line

try
	do shell script "mv ~/Downloads/*.dmg ~/Downloads/Images"
end try
try
	do shell script "mv ~/Downloads/*.sit ~/Downloads/Images"
end try