delete files in nested folders
delete files in nested folders
- Subject: delete files in nested folders
- From: Mike Flowers <email@hidden>
- Date: Tue, 18 Nov 2003 11:10:19 -0500
Hi all,
I am trying to make a script to delete files in nested folders 4 weeks after its creation date. I have this so far:
set PurgeDate to (current date) - (4 * weeks)
set fileRef to "MyMac:Cut CDs:test trash:"
tell application "Finder"
set bigList to list folder fileRef
set bigListpath to {}
repeat with eachItem in bigList
set tempbiglistpath to fileRef & eachItem
set atempbiglistpath to tempbiglistpath as alias
set kindof to kind of atempbiglistpath
if kindof is "folder" then
set tempbiglistpath to tempbiglistpath & ":"
set littlelist to list folder tempbiglistpath
set littleListpath to {}
repeat with eachlitem in littlelist
set the littleListpath to tempbiglistpath & eachlitem
set alittleListpath to littleListpath as alias
set kindofl to kind of alittleListpath
set llmod to modification date of alittleListpath
if kindofl is not "folder" and llmod < PurgeDate then
delete file littleListpath
end if
end repeat
end if
end repeat
try
empty
end try
end tell
But it tells me it cant get file .DS_Store. Can someone help me with this? If anyone has a better way to do it, let me know.
--
Mike Flowers
The Post and Courier
E-mail:email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.