set foo to choose file
try
alias foo
on error
display dialog "error"
end try
The “choose file” command returns an alias. So you will never ever get a warning. Because if you were able to choose the file then it exists. Quite obvious, isn’t it.:P;)
But maybe you could show us the code of the script where you want to use the existance test. In the example above the check is quite useless.
yes it is quiet obvious, but in fact,
I have an editable text field : user can
either type in the path to the file,
or to select the file using a ‘browse’ button’.
that’s why I want to check file existence , for the first case.