Re: check if a folder exists
Re: check if a folder exists
- Subject: Re: check if a folder exists
- From: Richard Baskett <email@hidden>
- Date: Wed, 08 May 2002 13:29:05 -0700
You can just do a:
if folder aPath exists then
statements
else
statements
end if
Rick
"We should be careful to get out of an experience only the wisdom that is in
it - and stop there; lest we be like the cat that sits down on a hot
stove-lid. She will never sit down on a hot stove-lid again--and that is
well; but also she will never sit down on a cold one anymore." - Mark Twain
>
From: Jean-Baptiste Le Stang <email@hidden>
>
Date: Wed, 08 May 2002 22:10:54 +0200
>
To: Mark Oglesby <email@hidden>, <email@hidden>
>
Subject: Re: check if a folder exists
>
>
You can try ChackPath 1.0 by Serge Belleudy-d'Espinose
>
(www.macscripter.net, applemods section)
>
You will find a mod to check wether or not a path is real.
>
Jean-baptiste
>
>
> 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.
>
_______________________________________________
>
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.
_______________________________________________
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.