Re: Get every file of the entire contents of a folder. Quickly.
Re: Get every file of the entire contents of a folder. Quickly.
- Subject: Re: Get every file of the entire contents of a folder. Quickly.
- From: kai <email@hidden>
- Date: Tue, 14 Oct 2003 07:07:01 +0100
on 14/10/03 6:57 am, I wrote:
>
--=======================
>
>
on EveryFileOfFolder(p)
>
set termExists to p's class is list
>
if termExists then
>
set folderAlias to p's item 1
>
set searchterm to p's item 2
>
else
>
set folderAlias to p
>
end if
>
>
set folderPath to quoted form of (POSIX path of folderAlias)
>
try
>
if termExists then
>
set filelist to paragraphs of (do shell script "find " & folderPath & " !
>
-name '\\.*' -type f | tr -s '//' | tr '/' ':' | grep " & searchterm)
>
else
>
set filelist to paragraphs of (do shell script "find " & folderPath & " !
>
-name '\\.*' -type f | tr -s '//' | tr '/' ':'")
>
end if
>
on error
>
return {}
>
end try
>
>
set prevDelim to text item delimiters
>
set text item delimiters to ":"
>
set DiskName to return & text item 1 of (folderAlias as Unicode text)
>
set text item delimiters to DiskName
>
set filelist to rest of (DiskName & (filelist as Unicode text))'s paragraphs
>
set text item delimiters to prevDelim
filelist -- Oops! Might help to return something! :-)
>
end EveryFileOfFolder
>
>
--=======================
---
kai
_______________________________________________
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.