• 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: Bernard Azancot <email@hidden>
  • Date: Wed, 14 Jul 2004 11:22:47 +0200

From: Nigel Smith <email@hidden>
To: Applescript Users List <email@hidden>

On 13/7/04 11:50, "Walter Ian Kaye" <email@hidden> wrote:

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:

Of course, you don't need to sort the entire list, you can just get the oldest few.

If you do want a sorted list of folder names, then

set theList to every paragraph of (do shell script "ls -t " & POSIX path of alias "path:to:folder")

Hello Nigel !

Thanks a lot for your answer.
I have tried your suggestion:

=====
tell application "Finder"
set theList to every paragraph of (do shell script "ls -t " & POSIX path of alias "IBM 01:Users:Parents:Desktop:Foo:")
end tell
=====

but the result stays empty
--> {""}

I must have missed something.
Any suggestion or other time sorting routines ?

Tanks in advance.

Yours.
Bernard
_______________________________________________
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: John Stewart <email@hidden>
  • Prev by Date: sending a fax from safari
  • Next by Date: Re: Counting & trashing
  • Previous by thread: RE:Counting & trashing
  • Next by thread: Re: Counting & trashing
  • Index(es):
    • Date
    • Thread