I can't figure out what is wrong?

Here’s the applesscript

It’s basically a backup script to backup files to a DVD. Here’s what’s wrong. Every time the script gets to this line:

the whole script just quits after it has finished excecuting this line. In both if statements.

This is what I have done to debug it:
1 I’ve added an ignoring application response.
2 I deleted all the spaces after the ‘command’ in question thinking that something might be there that I couldn’t see.
3 I’ve deleted all the remark lines, taken away all the spaces.
4 It all started when I added the line in question.
5 I added a try statement.

If you can figure this one out I will probably elevate you to the status of God Hero :smiley:

The command in question is undoubtly throwing some error or other, so your code is falling through to the ‘on error’ command, where you basically ignore it.

Replace the line:

end try

with:

 on error theErrMsg
display dialog theErrMsg
end try

This will at least tell you why the command is failing, enabling you to sort out the root cause.

Camelot,
Thanks for the help. It turned out to be permission errors. I couldn’t copy certain files so my script would quit at that point.