• 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: Determining If a File Exists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining If a File Exists


  • Subject: Re: Determining If a File Exists
  • From: Michelle Steiner <email@hidden>
  • Date: Thu, 11 Mar 2004 09:48:13 -0700

On Mar 11, 2004, at 9:25 AM, Marconi wrote:

Here's a snippet:

set fileName to name of the item_info
set OldFile to (targetFolder & fileName) as text
if file OldFile exists then
display dialog OldFile & " already exists."
end if

targetFolder is the path to a folder, so oldFile is a full path to a particular file (that may be) in the folder.

The error message I get is that [actual full path name] doesn't understand 'exists'

I could get it to work only if it's inside a "tell application 'finder'" wrapper.

tell application "Finder"
if file OldFile exists then
display dialog OldFile & " already exists"
end if
end tell

-- Michelle

--
"There's some good in the world, Mr. Frodo, and it's worth fighting for."
_______________________________________________
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.


References: 
 >Determining If a File Exists (From: Marconi <email@hidden>)

  • Prev by Date: Determining If a File Exists
  • Next by Date: Re: Determining If a File Exists
  • Previous by thread: Determining If a File Exists
  • Next by thread: Re: Determining If a File Exists
  • Index(es):
    • Date
    • Thread