• 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: The Save command will replace, without asking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The Save command will replace, without asking


  • Subject: Re: The Save command will replace, without asking
  • From: "Gary (Lists)" <email@hidden>
  • Date: Sat, 08 Oct 2005 10:11:14 -0400

"Dave Lyons" wrote:

RE: Looping through 'every item of' a folder in the Finder.

> However, this method [^] of checking file existence can be slow, if there
> are a large number of items in the folder (because Finder must build
> & return a list of the names of all the items).  Here's another way,
> using "exists":
>
> tell application "Finder"
> if item myfilename of folder targetfolder exists then ...
> end tell

[Firstly, and OT, thanks for moving your posts to the bottom, Dave. ;) ]


Despite my deep affection for the Finder, the 'exists' method has a high
rate of failure for me.

Here's a third (and fast) option which seems to be a common practice among
AS programmers:

try
    alias theThing
on error
    -- theThing doesn't exist
end try

--
Gary

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: The Save command will replace, without asking (From: Dave Lyons <email@hidden>)

  • Prev by Date: Re: long shot..
  • Next by Date: Re: Handler Call "can't continue" Illustrator CS
  • Previous by thread: Re: The Save command will replace, without asking
  • Next by thread: Best practice for activation of another application
  • Index(es):
    • Date
    • Thread