Hi
I need to recurse through a master folder located on an XSAN and delete from it, and any sub folders, all files over 90 days age from creation date.
I’m using the following code which works fine when you use ‘choose folder’ but if I hard code for the XSAN it throws this error- “Can’t make every file of <> of 'XSAN:mmtest:” into type <>."
I’m a windows programmer exploring Apple world so please bare with my ignorance
Appreciate any help.
cheers
Malcom
set DaysAgo to the (current date) - 90 * days
tell application “Finder”
activate
set f to (files of entire contents of (choose folder) whose creation date comes before DaysAgo) as alias list
– set f to (files of entire contents of ("XSAN:mmtest:) whose creation date comes before DaysAgo) as alias list
repeat with aFile in f
try
delete aFile
on error
display dialog “delete error, call engineering”
end try
end repeat
end tell
Browser: Firefox 2.0.0.7
Operating System: Mac OS X (10.4)