• 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: File check...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File check...


  • Subject: Re: File check...
  • From: Axel Luttgens <email@hidden>
  • Date: Wed, 24 Sep 2008 10:59:34 +0200


Le 24 sept. 08 à 09:21, Ashwin Row a écrit :

Hi
I'm using the following code but the part that checks if a file exists or not and it always returns true.
Please advise.
Also I'm having issues with using the exists keyword so I am not using that keyword.
Thanks in advance.


[...]

set theFolder to (POSIX path of ("/Applications/eShox/" & abc))

Hello Ashwin,

In the above, ("/Applications/eShox/" & abc) yields a string which already is a posix path.
(in fact, "posix path" is a property of a file object or an alias object)
So, this one is sufficient:


	set theFolder to ("/Applications/eShox/" & abc)


try get theFolder --file checking starts here...

And here you're just fetching the value of a variable; such a test may only fail if the variable isn't defined yet...
This should thus be more relevant:


		get (POSIX file theFolder) as alias

That is, since you already have a path, convert it to a file reference, then try to get the corresponding alias: if the target item doesn't exist, the attempt should fail.

HTH,
Axel _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: File check...
      • From: Ashwin Row <email@hidden>
    • Re: File check...
      • From: Ashwin Row <email@hidden>
References: 
 >File check... (From: Ashwin Row <email@hidden>)

  • Prev by Date: Changing permissions on a volume
  • Next by Date: Re: File check...
  • Previous by thread: File check...
  • Next by thread: Re: File check...
  • Index(es):
    • Date
    • Thread