Re: File exists on a posix path
Re: File exists on a posix path
- Subject: Re: File exists on a posix path
- From: Mark Lively <email@hidden>
- Date: Fri, 10 Feb 2006 14:42:47 -0500
On 2/10/06, Charles E. Heizer <email@hidden> wrote:
> Hello,
> I really don't use Applescript very offten but I have a need right
> now. I would like to know how to do a file exists on a posix file
>
> example:
>
> set y to "/usr/sbin/installer"
> set a to POSIX file y
> if (the file a exists) then
> display dialog " already exists"
> end if
>
>
Easiest way is
try
a as alias
display dialog "Its there"
on error
display dialog "Not sure where it is."
end
or
tell application "Finder" to if exists a then display dialog "This is
a little bit to long and pointless to be a simple notifier but its the
best I could do on such short notice. Besides its late on Friday, and
I missed the BOC on woot."
One final note a is a really bad variable name since it is defined in
some dictionaries. Y is a bit better. aFile is what I use in similar
situations.
-Mark
Who went to be at 12:30 deciding it wouldn't be worth the effort to
stay up the extra 30 minutes....
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden