Re: Script won't run consistently
Re: Script won't run consistently
- Subject: Re: Script won't run consistently
- From: Christopher Stone <email@hidden>
- Date: Thu, 10 Jul 2014 13:34:54 -0500
On Jul 09, 2014, at 10:38, Rob Lewis <email@hidden> wrote:
>
> My wife’s old iBook is strewn with AppleWorks files all over her user account and I want to collect them by creating a folder of aliases to them.
> ...
> The problem is, I can’t get consistent results on successive runs.
______________________________________________________________________
Hey Rob,
It's generally not a good idea to script the Finder for really big jobs. It's notoriously buggy and a memory hog.
Personally I would trot out the 800lb gorilla of find utilities - File Buddy - and search. But then again I already own File Buddy. (The demo should probably work well enough for this job, but you'd have to try it.)
http://www.skytag.com/filebuddy/en/index.html
FB will create aliases directly from its found list.
FB was not updated for a good while, but Larry has updated 10.x for Mavericks. So far I have seen no significant bugs.
EasyFind is a fairly nice freeware option.
http://www.devontechnologies.com/products/freeware.html
On the commercial but inexpensive front is FindAnyFile. Unlike EasyFind it will find as root. At only $6.00 U.S. it's a handy utility to have.
> One time, it quit with a “Finder can’t get…” error (so I wrapped that in a try block). The last run ended with “Apple Event timeout”.
If I was going to script this job for a whole hard drive (or more) I'd certainly use the shell and not AppleScript per se.
---------------------------------------------------------------------------------------------------------------------------------------
time find / -type f -iname "*.xlsx" > ~/Desktop/AppleWorks_File_Paths.txt
---------------------------------------------------------------------------------------------------------------------------------------
find (shell) { as root } { / -type f -iname "*.xlsx" } { 15 minutes } { Found 13 } { Found an extra embedded in an app }
EasyFind { not root } { All Words ".xlsx" } { 20 seconds } { Found 17 } { Some wrong - embedded text ".xlsx" }
EasyFind { not root } { Unix Wildcard "*.xlsx" } { 3 Minutes } { Found 12 }
File Buddy { as root } { Extension is "xlsx" } { 20 seconds } { Found 12 }
FindAnyFile { as root } { Name Ends in ".xlsx" } { 21 seconds } { Found 12 }
SpotLight { not root } { Name Ends With ".xlsx" } { ±5 seconds } { Found 11 }
SpotLight { not root } { Name Ends With ".xlsx" + System Files } { ±5 seconds } { Found 12 }
---------------------------------------------------------------------------------------------------------------------------------------
> Also this is my first attempt to use AppleScript’s “log” command. It appears to only work if the Event Log tab is selected when you start the script. Is that how it’s supposed to work? I’ve been a little wary of doing that (choosing the Result tab instead), worried that with thousands of files a huge log might cause other problems. Is this a concern?
You're right to worry. Thousands of lines of text adds overhead.
> Also, would it be better to search for creator type “BOBO” rather than file extension “cwk”?
You cannot be assured that every AppleWorks file on Mac OS X will have a file type or creator code (since those codes are deprecated), so you might miss some by searching only for one of those.
Again. I would use File Buddy.
I'd do a search for the file extension and save the path list.
I'd do a search for the file-type and save the path list.
Then I'd do a file compare in BBEdit and see if there were any differences.
--
Best Regards,
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden