Re: check if a folder exists
Re: check if a folder exists
- Subject: Re: check if a folder exists
- From: JollyRoger <email@hidden>
- Date: Wed, 08 May 2002 21:59:43 -0500
On 5/8/2002 12:35 PM, "Mark Oglesby" <email@hidden> wrote:
>
Can anyone give me an example of an if -then -else
>
statement that would check to see if a folder exists in
>
the finder.
This is the best method I've found to date - I use it in hundreds of my
scripts:
-- begin script
on FileExists(someFile)
try
set anAlias to (someFile as alias)
return true
on error
return false
end try
end FileExists
-- end script
Use it like this:
-- begin script
set testFile to (the path to the startup disk as text) & "Development:"
if my FileExists(testFile) then
display dialog "The folder exists."
else
display dialog "The folder does not exist."
end if
-- end script
HTH
JR
_______________________________________________
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.