check if a folder exists
check if a folder exists
- Subject: check if a folder exists
- From: Mark Oglesby <email@hidden>
- Date: Wed, 8 May 2002 13:35:59 -0400
Newbie alert!
Can anyone give me an example of an if -then -else
statement that would check to see if a folder exists in
the finder.
If a folder exists I want the finder to simply open it else I
want it to create it.
this is the script I have so far:
--set inital variables
set people to {}
set currentDate to current date
set currentMonth to month of currentDate
set currentDay to day of currentDate
set dateFolder to currentDay & "_" & currentDay as
string
tell application "Finder"
--get list of people getting email
list folder (alias "DEC6:Master_Email_%0:")
set people to people & result
set mailOwner to choose from list people with prompt
"This mail belongs to:"
try
set folderAddress to ("DEC6:Master_Email_%0:" &
mailOwner & ":")
make new folder at alias folderAddress with
properties {name:dateFolder}
set finalFolder to folderAddress & dateFolder
open folder finalFolder
on error errmsg number errNum
display dialog "This days folder is already there"
set alreadyThere to result of button
end try
end tell
Thanks for the help. This list has been a great source
of info.
Mark Oglesby
email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.