Created
November 1, 2013 21:37
-
-
Save ncremins/7272349 to your computer and use it in GitHub Desktop.
Apple script to purge downloads, this can be easily set up in automator to run every day.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- number of days until purge. | |
set modDate to (60) | |
-- Only do for the current user. | |
tell application "System Events" | |
set currentUser to (name of current user) | |
end tell | |
-- Delete | |
tell application "Finder" | |
try | |
delete (every item of folder "Downloads" of folder currentUser of folder "Users" of startup disk whose modification date is less than ((current date)) - modDate * days) | |
end try | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment