how to know if import failed?

does anyone know a trick off hand to know if an attempted import failed?

I am fairly sure DT does not support .vcf files (too bad). but how do you know this fails?


tell application "Finder"
	set thefile to choose file
        -- pick a .vcf file
end tell

tell application "DEVONthink Pro"
	set res to import thefile
end tell
-- no result

Well, the result would be something if it imported correctly, so perhaps a null result is all the trigger you need. if res is equal to {} then shit blood, or something.

duh, I knew that! was a late night bleary eyed thing. You sort of have to test it several ways, because it doesn’t typically error out.

It would be nice if DTP somehow reported why an import failed. (bad path, permissions, etc.)


tell application "Finder"
	set thefile to choose file
end tell
tell application "DEVONthink Pro"
	set sukses to false
	try
		set addedrec to import thefile
		set testit to addedrec
		set sukses to true
	on error
		set sukses to false
	end try
end tell
if testit is missing value or testit is null then set sukses to false

set result to sukses