Re: Check if folder exists??
Re: Check if folder exists??
- Subject: Re: Check if folder exists??
- From: Steven Angier <email@hidden>
- Date: Thu, 13 Dec 2001 10:55:09 +1100
- Organization: Macscript.com
Robbie Newton wrote:
>
>
Is there a way to check if a folder exists before you try to create a new
>
one.
>
>
Here9s what9s happening... I have a script that creates a folder depending
>
on data that has been entered into FileMaker. But I don't want the user to
>
be able to create the folder twice, because that will give an error. So
>
basically I am trying to trap that option with the intent of displaying a
>
message to the user of something like: "you have already made this folder"
>
>
So can you check to see if a folder exists before making a new one?
The Macscript.com Library has a host of functions for working with files and folders,
including:
DoesFileExist(theFile) -- checks to see if the given file item exists
IsFolder(theFile) -- checks to see if the given file item is a folder
CreateFolder(theFolder) -- creates the given folder if it doesn't exist already (it
doesn't do anything if the folder already exists)
You can download a demo of the Library from our website: <
http://www.macscript.com>
Steven Angier
Macscript.com