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: Paul Berkowitz <email@hidden>
- Date: Fri, 19 Jan 2001 22:26:49 -0800
On 1/19/01 2:26 PM, "Michelle Steiner" <email@hidden> wrote:
>
Can this script fragment be simplified? It bothers me that I had to type
>
the tell statement twice, and wonder if there's a way to avoid the
>
repition.
>
>
--Michelle
>
>
set longAgo to (current date) - 14 * days
>
try
>
tell application "Finder" to set thefilelist to every item ,
>
of thefilepath whose modification date is less than longAgo
>
on error
>
set the thefilepath to choose folder
>
tell application "Finder" to set thefilelist to every item ,
>
of thefilepath whose modification date is less than longAgo
>
end try
>
By a bit:
---------------
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
-------------------------
although the results are in that rather cumbersome Finder format.
--
Paul Berkowitz