Re: easy way to check if item is file or folder
Re: easy way to check if item is file or folder
- Subject: Re: easy way to check if item is file or folder
- From: Jolly Roger <email@hidden>
- Date: Wed, 20 Dec 2000 15:01:22 -0600
- Replyto: email@hidden
on 12/20/2000 2:10 PM, Jon Kreisler wrote:
>
This has worked:
>
>
set x to "Macintosh HD:Desktop Folder:File_A"
>
set xInfo to info for alias x
>
set xFolder to folder of xInfo
>
display dialog "Folder is:" & xFolder as text
Using "info for" will be slow and can fail if the folder contains more than
2 gigabytes of data.
Use string manipulation instead - it's faster, and cannot fail if the folder
is too large:
set thePath to (choose file) as text
set isFolder to ((character -1 of thePath) = ":")
log the result
set thePath to (choose folder) as text
set isFolder to ((character -1 of thePath) = ":")
log the result
HTH
JR