• 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: Performance when Checking if File Exists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Performance when Checking if File Exists


  • Subject: Re: Performance when Checking if File Exists
  • From: Arthur J Knapp <email@hidden>
  • Date: Fri, 22 Feb 2002 13:17:40 -0500

> Date: Fri, 22 Feb 2002 06:40:42 -0800 (PST)
> From: Daniel Shockley <email@hidden>
> Subject: Re: Performance when Checking if File Exists


> I need to post a MAJOR correction. Richard Morton reminded me that
> what I thought I had worked on was completely his work, posted on
> the applescript-users list.

>> One thing I find a little, err, curious about this is that it
>> bears more than a passing resemblance to the one I posted to AS
>> Users on 7 Jan of this year, on a thread you had contributed to -
>> "Re: How can i do?... ("exists" handler)".

I am suspicious of the whole affair: I say that we should convene a
meeting of the AppleScript-Users Ethics and Protocols Committee.

;-)



>>> if inputPath is not equal to "" then try
>>> get alias inputPath as string
>>> return true
>>> end try
>>> return false

That "if" is a great addition. :)


> This second handler is just an example of how you can extract
> more information about the existence/non-existence of the path:
>
> on verifyPath( pathString )
> try
> alias pathString
>
> on error errmsg number errnum
>
> if errnum = -35 then
> return "disk does not exist"
>
> else if errnum = -120 then
> return "a folder does not exist"
>
> else if errnum = -43 then
> return "the file does not exist"
>
> else
> error errmsg number errnum
> end if
> end try
>
> return "exists"
>
> end verifyPath


{ Arthur J. Knapp, of <http://www.STELLARViSIONs.com>
<mailto:email@hidden>
try
<http://homepage.mac.com/kshook/applescript.html>
on error number -128
end try
}
_______________________________________________
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: Performance when Checking if File Exists
      • From: Richard Morton <email@hidden>
  • Prev by Date: Re: UNIX line breaks in an AppleScript created text document
  • Next by Date: Re: Difficulty with b/u script on 10.1.3
  • Previous by thread: Re: Performance when Checking if File Exists
  • Next by thread: Re: Performance when Checking if File Exists
  • Index(es):
    • Date
    • Thread