• 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
RE: Exists statements
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Exists statements


  • Subject: RE: Exists statements
  • From: Ed Walter <email@hidden>
  • Date: Tue, 22 Oct 2002 10:12:10 -0500

I'd try something like this:

tell application "Finder"
if not (exists file "dpath" of preferences folder) then
set dataFolder to choose folder with prompt "Locate data
Folder"
else
set dataFolder to path to preferences folder
end if
end tell

-ed-

-----Original Message-----
From: email@hidden [mailto:email@hidden]
Sent: Tuesday, October 22, 2002 9:54 AM
To: email@hidden
Subject: Exists statements


I'm writing a script that needs to determine if a certain file exists or
not. I need to have it perform an action only if the file does not exist.
This is where I'm running into problems. The code I have so far is:

tell application "Finder"
if {file "dpath" of folder "preferences" of folder "system folder" of
startup disk exists} is "false" then choose folder with prompt "Locate data
Folder"

What needs to happen is a prompt that will direct the user to locate a
certain folder if the file does not exist. And then I need to copy the
location of the selected folder to the clipboard for future pasting. Thank
you
_______________________________________________
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.

  • Prev by Date: Exists statements
  • Next by Date: tell app <script> to handler(a,b) doesn't work
  • Previous by thread: Re: Exists statements
  • Next by thread: tell app <script> to handler(a,b) doesn't work
  • Index(es):
    • Date
    • Thread