• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Check if folder exists??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Check if folder exists?? (From: Robbie Newton <email@hidden>)

  • Prev by Date: RE: Check if folder exists??
  • Next by Date: Re: Check if folder exists??
  • Previous by thread: Check if folder exists??
  • Next by thread: Re: Check if folder exists??
  • Index(es):
    • Date
    • Thread