• 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
Of files, lnks and existence
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Of files, lnks and existence


  • Subject: Of files, lnks and existence
  • From: Brian Johnson <email@hidden>
  • Date: Fri, 10 Jun 2005 16:36:43 -0700 (PDT)


It seems to me that when testing files for exisistence:

1. The Finder can test a file "x" for existence with

  tell application "Finder"
    set y to exists file x
  end tell

This test recognizes soft link (lnk) folders, (and maybe Finder aliases) but accepts 'displayed names" (i.e. files with hidden extensions) as the same as true file names.

2. the "as alias" test in a try block

  try
    file x as alias
    set y to true
  on error
    set y to false
  end try

This test DOES NOT recognize soft link folders, but properly distinguishes between displayed names and real names. That is, a file specification which fails the "as alias" test may still be used with

  set f1 to open for access


It seems that if I apply test 1 (which I used too do) and the file's name has a hidden ".text" (for example), my script'll be screwed up when it tries to open the file, but if I use test 2, it'll be screwed up if the path is complex (and in my case, these are files accessed by cgi and within an apache virtual-host web server structure on two different volumes--their paths are complex).


It seems that you can't win.  True?

 - brian johnson, dept of architecture, university of washington, seattle
_______________________________________________
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


  • Prev by Date: Re: Script Objects - help please!!
  • Next by Date: Re: Mail: Finding messages by ID
  • Previous by thread: Controlling execution priority of a script
  • Next by thread: iCal scripting help
  • Index(es):
    • Date
    • Thread