Re: File check...
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