How to Check if a Folder Already Exists?

Hey guys...need some help.


I am currently using the script below to find and see if a folder exists...but I found that the script only works for the desktop.


How can I change the "path to desktop" to point to my Library folder?


This is for an application I am making...so you will get credit in the app for helping me.


Script:

set location_folder to (path todesktop)

set check_foldername to (location_folder as string) & "RecoverMe"

tell application "Finder"

if (not (exists folder check_foldername)) then


makenewfolderatlocation_folderwith properties {name:"RecoverMe"}

end if

end tell



Thanks,

Adam B




Applescript Editor-OTHER, Mac OS X (10.7)

Posted on Jan 22, 2012 2:25 PM

Reply
2 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to Check if a Folder Already Exists?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.