Re: Is there any way to simplify this?
Re: Is there any way to simplify this?
- Subject: Re: Is there any way to simplify this?
- From: Michelle Steiner <email@hidden>
- Date: Fri, 19 Jan 2001 23:14:53 -0800
On 1/19/01 10:26 PM, Paul Berkowitz <email@hidden> wrote:
>
set longAgo to (current date) - 14 * days
>
try
>
thefilepath
>
on error
>
set the thefilepath to choose folder
>
end try
>
tell application "Finder" to set thefilelist to every item of
>
thefilepath whose modification date is less than longAgo
>
-------------------------
Hey that's neat. I like it. Thanks.
>
although the results are in that rather cumbersome Finder format.
No problemo; the next block is
tell application "Finder" to set totalFiles to count every file of
thefilepath
if totalFiles is greater than Maxfiles then
set counter to count thefilelist
tell application "Finder" to move items of thefilelist to the trash
end if
So, I don't need to display the results of thefilelist. (I guess I
should have called it theFolderPath, though.)
The rest of the script displays a dialog telling me how many files were
moved to the trash and the total number of files in the trash; if there
are any files in the trash, it asks if I want to empty the trash.
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------