• 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: Get every file of the entire contents of a folder. Quickly.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:44:10 +0100

on 14/10/03 6:57 am, I wrote:

> on EveryFileOfFolder(p)...

Come to think of it - I could have cleaned that up a bit better:

--=======================

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)
set shellFind to "find " & folderPath & " ! -name '\\.*' -type f | tr -s
'//' | tr '/' ':'"
if termExists then set shellFind to shellFind & " | grep " & searchterm
try
set filelist to paragraphs of (do shell script shellFind)
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
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.

  • Follow-Ups:
    • Re: Get every file of the entire contents of a folder. Quickly.
      • From: Paul Skinner <email@hidden>
References: 
 >Re: Get every file of the entire contents of a folder. Quickly. (From: kai <email@hidden>)

  • Prev by Date: Re: Get every file of the entire contents of a folder. Quickly.
  • Next by Date: Re: Illustrator Scripting Help Needed
  • Previous by thread: Re: Get every file of the entire contents of a folder. Quickly.
  • Next by thread: Re: Get every file of the entire contents of a folder. Quickly.
  • Index(es):
    • Date
    • Thread