see if folder exists?

how can I see if a folder exists… then if it dosnt create it

This is the code I use. It will make folders for each folder in the path that doesn’t already exist:

Jon

This is not as thourough as Jon’s script…

But it will create a new folder named ‘newfolder’ on the desktop, if a folder named ‘newfolder’ is already there it displays a dialog syaing so.

ok and then using your code… how would i see if a folder exists at the path: “home:documents:MY_FOLDER”?

**how do i specify to AS where my “home” folder is?

To get the path to the current user’s home folder (or documents folder):

Jon

You can use shell’s “mkdir”, which can also create recursive directories:

set thePath to "/Applications/Wok/lonely/people/in/the/world/"
do shell script "mkdir -p " & quoted form of thePath

If it doesn’t exist folder “Wok” inside the applications folder, this should create any folder thru the end (“world”).

Cheers…