• 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 : Finder: Delete files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re : Finder: Delete files


  • Subject: Re : Finder: Delete files
  • From: "olivier" <email@hidden>
  • Date: Mon, 25 Jun 2001 17:28:10 +0200

> The problem is that date arithmetic does not return a date, but returns
> the number of seconds between dates.
>
> Paul's suggestion is elegant.
>
> --Michelle
>
> ----------------------------------------------------------------------
> | Michelle Steiner | We're not human beings having a spiritual |
> | | experience. We're spiritual beings |
> | email@hidden | having a human experience. |
> ----------------------------------------------------------------------

Hi Paul, Michelle, Hugh,

I've try this.. no result ! Why ?

set midnight to date (date string of (current date))
tell application "Finder"
delete (every file of (choose folder) whose (modification date) < midnight)
-- empty trash
end tell


I write this script, and it's work fine:

set midnight to date (date string of (current date))

tell application "Finder"
set FolderToClean to (choose folder)

set i to count of files of FolderToClean
repeat while i > 0
if (modification date of file i of FolderToClean) < midnight then delete
file i of FolderToClean
set i to i - 1
end repeat
end tell


any other suggestion ?

TIA


Oli.


  • Follow-Ups:
    • Re: Re : Finder: Delete files
      • From: Hugh Dixon <email@hidden>
  • Prev by Date: Re: finder under 10
  • Next by Date: migrating script to later OS
  • Previous by thread: RE: AppleScript and a server
  • Next by thread: Re: Re : Finder: Delete files
  • Index(es):
    • Date
    • Thread