Re: FindFile (answered)
Re: FindFile (answered)
- Subject: Re: FindFile (answered)
- From: David Blache <email@hidden>
- Date: Mon, 04 Dec 2000 15:18:11 -0600
on 12/4/2000 10:33 AM, Joe wrote:
>
I'm trying to write a script that will find all files in a certain folder
>
that have creation dates that are older than 5 days before the current date.
>
>
I've tried writing the script using the FindFile addition but I keep getting
>
this errror " because *Ox//* the original item cannot be found 32768029"
>
>
Here is the script, can someone let me know what I'm doing wrong or if there
>
is a better way of doing this:
(snip)
Hi Joe,
FindFile is not the problem.
First, only one line in your script is a Finder command. Remove the
tell/end tell block and only tell the Finder what belongs to the Finder.
Second, the error is happening on the line that moves the files. The Finder
doesn't understand a list of aliases for the move parameter (why? I don't
know). To move all items at once with the move command, you need to supply
a list of file specifications. So change your script like so:
set sourceFolder to choose folder with prompt "Select a folder to search:"
set destFolder to choose folder
set ayearago to (current date) - 5 * days
set theList to FindFile in_folder sourceFolder date_modified_is_before
ayearago result_type "fss "
tell application "Finder" to move theList to destFolder
This works for me.
-David
References: | |
| >FindFile (From: Joe <email@hidden>) |