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):
set path_to_Home to ((path to “cusr”) as string)
set path_to_Documents to ((path to “docs”) as string)–this script was automatically tagged for
–color coded syntax by Script to Markup Code
–written by Jonathan Nathan
Jon
how can I see if a folder exists… then if it dosnt create it
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…