Re: Finding a date...
Re: Finding a date...
- Subject: Re: Finding a date...
- From: Ron Hunsinger <email@hidden>
- Date: Thu, 12 May 2011 10:47:40 -0700
On May 12, 2011, at 10:20 AM, Jeff Justice wrote:
> Is there a way I can find the earliest files, i.e what is the earliest creation date and move those? Something like this:
>
> Find earliest creation date
> Create and name a folder with that date
> Move those files into the folder
> Repeat
>
> Until the original folder is empty. And then obviously run this workflow once a week or so.
I'd turn that loop inside out.
repeat with every file in the original folder
get the file's creation date
if there is not already a folder for that date, create it
move the file to the folder for its date
end repeat
That avoids the problem of finding the oldest file (which, one way or another, entails sorting all the files on creation date, and then doing that sort all over again the next day, and the next...). It also allows you to run the script in mid-day, dealing properly with files created later in the day that you last ran the script.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden