do shell script error dialog

Hi,

I’ve got a “do shell script” cpios some files for later moving.

Some of the files are buried deep in the folder hierarchy, which apparently gives me an error if the resulting file name is too long.

The command executes without problems, but when it comes to handling the error message, it posts a dialog box with my only possibility is to stop the script.

I know that I will ALWAYS have errors. All I need to do is know which ones they are.

I tried the following

set scriptResult to do shell script "~/bin/incrBackup"

however this doesn’t seem to trap errors, only normal results.

Anyone know how I can catch errors?

Han Solo

Hello,
I think this is what you are looking for

To return an error number

try
	set thescript to "Your Script"
	do shell script thescript
on error number errnumber
	return errnumber
end try

Or to return the error itself

try
	set thescript to "Your Script"
	do shell script thescript
on error errname
	return errname
end try

for more info on do shell script go to
http://developer.apple.com/technotes/tn2002/tn2065.html