Hello:
I am looking for some advice on how to delete dated folders older than 30 days. I created an applescript to archive files daily by placing them in daily dated folders inside another “backup” folder. Now, I am looking to have those folders deleted 30 days from creation:
Here is my current script that works on one folder “Test”, but the problem is the name of every folder will change when I put this into production based on my above criteria:
tell application “Finder”
activate
set filedata to info for folder “Test” as alias
set aMonthAgo to the (current date) - 30 * days
if creation date of folder “Test” comes before aMonthAgo then
delete folder “Test”
end if
end tell
Any help is appreciated. Thank you!