• 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: Counting & trashing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Counting & trashing
      • From: Nigel Smith <email@hidden>
References: 
 >Counting & trashing (From: Bernard Azancot <email@hidden>)

  • Prev by Date: Counting & trashing
  • Next by Date: Re: Counting & trashing
  • Previous by thread: Counting & trashing
  • Next by thread: Re: Counting & trashing
  • Index(es):
    • Date
    • Thread