• 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: Tony Bennett <email@hidden>
  • Date: Thu, 22 Jan 2009 15:14:54 -0600

Michelle,

Sorry for the delayed response but thanks for the script. It works fine and I now need to get Carbon Copy Cloner to run a shell script that runs this applescript (using 'osascrip't I would guess). CCC can run a shell script before and after a backup. This whole procedure might be done within a shell script but, alas , I am not proficient in such matters.

Thanks again,
Tony


On Jan 14, 2009, at 10:52 PM, Michelle Steiner wrote:

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 (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden

_______________________________________________ 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
References: 
 >Folder items to trash (From: Tony Bennett <email@hidden>)
 >Re: Folder items to trash (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Color Management Classified Ads?
  • Next by Date: Re: Excel, External Data
  • Previous by thread: Re: Folder items to trash
  • Next by thread: Four scripts for Finder and Terminal
  • Index(es):
    • Date
    • Thread