Re: Get the "last" folder...
Re: Get the "last" folder...
- Subject: Re: Get the "last" folder...
- From: Andrew Oliver <email@hidden>
- Date: Thu, 15 Sep 2005 15:06:33 -0700
Title: Re: Get the "last" folder...
On 9/15/05 10:48 AM, "Stefan Eriksson" <email@hidden> wrote:
what i want is a script that scans thro everything from a topfolder and down the hierarcy and only reports the folders that contains files, not folders...
Try this :
global foldersWithNoFiles
set topFolder to (choose folder)
set foldersWithNoFiles to {}
checkFolder(topFolder)
on checkFolder(theFolder)
tell application "Finder"
-- do we have any files?
if number of files of folder theFolder = 0 then
-- no, so add this to the list of file-less folders
copy theFolder to end of foldersWithNoFiles
end if
-- now get all sub-folders
set subfolders to (folders of folder theFolder)
--iterate through them
repeat with eachFolder in subfolders
-- be recursive
my checkFolder(contents of eachFolder as alias)
end repeat
end tell
end checkFolder
foldersWithNoFiles
Andrew
:)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden