Re: Check if folder exists??
Re: Check if folder exists??
- Subject: Re: Check if folder exists??
- From: Jean-Marie Hoornaert <email@hidden>
- Date: Wed, 12 Dec 2001 19:40:10 +0100
le 12/12/01 18:34, Robbie Newton a ecrit :
>
Hi again ;O)
>
>
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?
tell application "FileMaker Pro"
set path_folder to "HD:Folder:Sub_folder:"
-- set path_folder to cell "path to folder" of current record
set name_folder to "the new folder"
-- set name_folder to cell "name of folder" of current record
set test_folder to (path_folder & name_folder & ":") as string
end tell
tell application "Finder"
if not (exists alias test_folder) then ,
make new folder at alias path_folder ,
with properties {name:name_folder}
end tell
--
French is my first language, Dutch my second and ...
AppleScript my third.
Cordialement (cordially)
____________________
Jean-Marie -HOO;-)
____________________
Jean-Marie Hoornaert
email@hidden
http://www.h2o.be
AppleScripting FileMaker
French web site