• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
check if a folder exists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: check if a folder exists
      • From: JollyRoger <email@hidden>
    • Re: check if a folder exists
      • From: Jean-Baptiste Le Stang <email@hidden>
    • Re: check if a folder exists
      • From: Paul Skinner <email@hidden>
    • Re: check if a folder exists
      • From: Rob Jorgensen <email@hidden>
  • Prev by Date: RE: Folder Actions on Shared Folders
  • Next by Date: Re: What happened to "file"?
  • Previous by thread: RE: Folder Actions on Shared Folders
  • Next by thread: Re: check if a folder exists
  • Index(es):
    • Date
    • Thread