I now have an applescript up and running that moves lots [1000s] of files from one folder to another [archive] folder depending on the file’s creation date.
It works but it’s so slow as to be unusable…
It works by stepping through the files one by one, getting the creation date and doing a move if necessary.
Anyone have any better ideas that might work with large numbers of files?
Thanks!
John Milton
: I now have an applescript up and running that moves lots
: [1000s] of files from one folder to another [archive]
: folder depending on the file’s creation date.
: It works but it’s so slow as to be unusable…
: It works by stepping through the files one by one,
: getting the creation date and doing a move if
: necessary.
: Anyone have any better ideas that might work with large
: numbers of files?
: Thanks!
: John Milton
I am assuming that you are using Finder to archive your files. If so, this is a slow way to do it. A better idea would be to use OSAXen, as they are faster and have more options. Some of the more diverse are Akua Sweets, Jon’s Commands, XCMD OSAX, Tanaka’s OSAX, Satimage, Resource Utilities and many others. Akua Sweets has especially good file handling commands. Hopes this helps some. By the way all of these OSAX can be found on this site.
: " It works but it’s so slow as to be unusable…
: "
: Have you tried using “whose” clauses? E.g.,
: name of every file whose creation date is greater than
: some_date?
There’s a bug in the Finder’s ‘whose’ filter that gives erratic results with numerical values such as dates, sizes, and capacities. Only use it for booleans and strings!
NG
" It works but it’s so slow as to be unusable… "
Have you tried using “whose” clauses? E.g., name of every file whose creation date is greater than some_date? Does the script run faster when the Finder is the foreground application or when the script applet is the foreground application; add code to force one or the other? (Oh, and the script isn’t activating itself then activating the Finder is it? – flipping back ‘n’ forth will slow it down.)
mg
Thanks to all those who posted suggestions here - I’ll check them all out.
BTW my original script did include a ‘whose’ clause using a ‘less than or equal to’ test against the creation date of the files - but it didn’t work properly [>= and <= seemed to have the logic the wrong way round]…just made me a bit nrevous and I dropped it…
Is there anywhere to check on known bugs for Applescript?
Getting a handle on where all the information is has been my biggest problem with getting into Applescript after years of programming in other languagues… [So far I’ve been scouring the apple site, this site and have a couple of books - reading other people’s scripts has been by far the most usesful exercise though].
Thanks again one and all
John Milton