Re: do shell script gotcha
Re: do shell script gotcha
- Subject: Re: do shell script gotcha
- From: Nigel Smith <email@hidden>
- Date: Fri, 28 Feb 2003 10:03:00 +0000
On 26/2/03 5:44, "Donald Hall" <email@hidden> wrote:
>
Chris,
>
>
Thanks very much for the suggestion. This is what I ended up with:
>
>
try
>
do shell script "test -e " & POSIX path of myFile
>
on error
>
-- myFile doesn't exist, must create it
>
end try
And...
>
There are all sorts of fun things that "test" can do. the "-e" succeeds
>
if a file of any type exists with the name specified. In this case test
>
will return 0. If the file doesn't exist test returns 1 which causes do
>
shell script to throw an error...
Note that "test -e" will be true if a file *or a directory* of that name
exists. This may or may not matter.
Nigel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.