• 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: Folder items to trash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder items to trash


  • Subject: Re: Folder items to trash
  • From: Michelle Steiner <email@hidden>
  • Date: Wed, 14 Jan 2009 21:52:28 -0700

On Jan 14, 2009, at 9:28 PM, Tony Bennett wrote:

I hope someone on the list can make quick work of this. I would like to write a script that would run unattended ever morning to move all files of a specific folder, older than 30 days, to the trash.

Here is the part of the script that will delete the files; you will need to change the file, of course, to the one you want.


Someone else will have to write what is needed to trigger the script at a specified time of day.

set FolderToBeProcessed to alias ((path to desktop as text) & "untitled folder")
tell application "Finder"
delete (files of the FolderToBeProcessed whose modification date is less than (current date) - 30 * days)
end tell


-- Michelle

--
Never play strip Tarot.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Folder items to trash
      • From: Tony Bennett <email@hidden>
References: 
 >Folder items to trash (From: Tony Bennett <email@hidden>)

  • Prev by Date: Folder items to trash
  • Next by Date: Four scripts for Finder and Terminal
  • Previous by thread: Folder items to trash
  • Next by thread: Re: Folder items to trash
  • Index(es):
    • Date
    • Thread