Re: Counting & trashing
Re: Counting & trashing
- Subject: Re: Counting & trashing
- From: Walter Ian Kaye <email@hidden>
- Date: Tue, 13 Jul 2004 03:50:00 -0700
At 11:16a +0200 07/13/2004, Bernard Azancot didst inscribe upon an
electronic papyrus:
Hello Scripters !
I am trying to write a script that performs the following tasks:
1 - count the folders in a container backup folder
2 - if the total number of folders is > 15, select & delete the
exceeding older folders .
tell app "Finder"
set flist to every folder of folder foo
set fc to count flist
if fc > 15 then
--###sort flist based on creation date;
--###i leave this bit to those who have written sorting routines.
--assuming flist_sorted output:
repeat with i from 16 to fc
set f to item i of flist_sorted as item
delete f
end repeat
end if
For my information, I would like to know what this script could
become if I want to do the same thing using now a time criteria:
- select folders whose creation date is < today's date minus 15
days, an delet them.
What it could become? I dunno, a persimmon-eating aardvark?
-boo
who went ice skating tonight for the first time in over 30 years. Wheeeee!
Life: there ain't much else like it. --WIK, about an hour ago
_______________________________________________
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.