Difficult File Find Task (OS 9.2.2)

Discussion in 'Apple' started by Alex Wenzel, Apr 18, 2004.

  1. Alex Wenzel

    Alex Wenzel Guest

    Hi,

    I wonder how I cauld do the following search:

    Find all Folders that contain only one item which is a folder (and no files)
    whose (the "inside" folder's) name contains the string "_files".

    The reason I want to do this has to do with a bug of Mozilla (i use 1.2;
    which is not the last "official" version for OS9; but 1.2.1 had the same
    bug, plus others): I save lots of webpages complete with images etc. Mozilla
    should put the plain HTML part in the folder where I save into plus generate
    a folder named "_files" appended to the HTML file's name (and minus the
    ".html" part) into which it puts all the other files (graphics etc.).
    Sometimes this fails and it will only produce the "..._files" subfolder and
    not save the main HTML page. You won't notice that until you control it in
    the finder (which is too much effort to do it everytime). I certainly have
    *a lot* of these cases where the page that I thought saved is missing. So I
    want to find these to repair the most important ones. But how to find them?

    Obviously, I can't do this with Sherlock (or can I?). Is there a different
    possibility? Another app that can do that? Or a script?

    I'm running OS 9.2.2 on a G3 b/w.
    I didn't know where to put this post. As it's somehow related to Sherlock
    (and maybe AppleScript, if that's a way to solve it), I posted it to
    c.s.m.system.

    Thanks for help.
    Alex
     
    Alex Wenzel, Apr 18, 2004
    #1
    1. Advertisements

  2. Try QuickFind 3.1, free at Version Tracker and MacUpdate.
     
    John Rethorst, Apr 18, 2004
    #2
    1. Advertisements

  3. apple script
    the search engine at the finder is brain dead to multiple query
    constraints. It is all one way (conjunction) or the other with no
    method to combine them.

    As I recall OS9s query engine *or*ed everything
    so a search for a, b, c, d
    becomes A or B or C or D

    in OSX (panther)
    so a search for a, b, c, d
    becomes A & B & C & D
     
    Fetch, Rover, Fetch, Apr 18, 2004
    #3
  4. Alex Wenzel

    Alex Wenzel Guest

    I tried, but I can't see any way to enter a query like the one I need:

    Find folder that contains exactly one item that is a folder whose name
    contains "_files".

    Or did I miss something?

    Regards,
    Alex

    --
    To reply, remove "NOMORESPAM" from address.


    BTW: Although QuickFind is free, not all of the three required scripting
    additions are ("Find Document" is 5$ shareware). Plus, the AkuaSweets
    HQX/HTTP dl is corrupted (the SIT/FTP one works).
     
    Alex Wenzel, Apr 18, 2004
    #4
  5. Alex Wenzel

    Alex Wenzel Guest

    Sorry, I don't understand that.
    I'm not exactly what one would call AppleScript savvy.
    What do you mean with "apple script"?
    I have no idea how a search like the one I need would be set up and
    formulated:
    The task is to find any folder that contains exactly one item that is a
    folder whose name contains "_files" (and the parent folder should contain no
    files, just this one subfolder).

    The search engine problem you describe doesn't seem to me to be related to
    that (or am I wrong?).

    Alex
     
    Alex Wenzel, Apr 18, 2004
    #5
  6. I tried, but I can't see any way to enter a query like the one I need:

    Find folder that contains exactly one item that is a folder whose name
    contains "_files".[/QUOTE]

    What I would do is use the Finder's Find function to find folders whose
    name contains "_files" and then manually inspect their containing
    folders.

    The problem with using Applescript, as someone suggested, is that a
    script would have to search the entire disk, iteravely, and that would
    take a long time.
     
    Michelle Steiner, Apr 19, 2004
    #6
  7. your script would do something like this(this is NOT real code):
    * examine the folder for its content -
    * if the content is what you are looking for delete it(or whatever)
    * otherwise, check all the originating folder's contents for other
    folders, and then check their contents (see above step one)
    * until there are no more folder left to examine.

    you can set this up so that you can drag n drop a starting folder (say
    your 'html downloads' folders).

    As for time - I have an applescript which sets window view (column),
    window position, size, and name column size; this script when run on a
    120g drive take about 15 minutes. - however there is a LOT of time which
    is spent on opening, closing and redrawing the screening (since the
    window/folder has to be open in a window for view settings to be set.

    My guess is that even doing an entire drive the above outlined
    applescript would take between 20 and 90 seconds to complete once written.
     
    Fetch, Rover, Fetch, Apr 19, 2004
    #7
  8. Alex Wenzel

    matt neuburg Guest

    See my .sig. Suffice it to say that I could write the script to do the
    serach you describe in about a minute. It is true, as someone pointed
    out, that it would take a long time to run, but I don't find that fact
    interesting. I sleep sometimes, so there's plenty of opportunity for my
    computer to do long-running tasks without getting in my way. m.
     
    matt neuburg, Apr 19, 2004
    #8
  9. Alex Wenzel

    Alex Wenzel Guest

    I just did a search like that with Sherlock. Several thousand items found.
    This suggestion is not practical, unfortunately. Especially not if I have to
    do it regularly.
    Time wouldn't matter (it can run all day, it doesn't matter, as I will be at
    work at that stupid PC...).

    Alex
     
    Alex Wenzel, Apr 19, 2004
    #9
  10. Alex Wenzel

    Alex Wenzel Guest

    If you don't find a solution to this, try using iCab for the
    I was almost sure that would come up. Yes, I used iCab for a while and
    abandoned it for one very good reason: The method you describe *does not
    work*. Did you ever try it? It's implemented in a way that you will only use
    it a few times.
    I would prefer iCab otherwise (Mozilla is sluggish, abandoned and has a lot
    of annoying bugs).
    Here's why it doesn't work: not only doesn't it append ".zip" to the
    filename (which you would need for opening it on a different plattform), the
    archives are organized in a way that makes them useless for use without iCab
    or on other platforms:
    When you unpack them, the unpacked folder consists of an empty file named
    "iCabWebArchive" plus several subfolders (which contain additional
    subfolders etc.). The main page is buried somewhere down in some subfolder
    whose name is not consistent (mostly the folder's name is www.something,
    from the site's domain). So how does iCab itself find the file inside the
    archive? The zip file contains near its beginning the path to the file that
    is the starting point (graphics etc. are referenced from there). Here's an
    example from the data fork of a random iCab archive on my hard drive:
    www.de.tomshardware.com/motherboard/19980731/sock7_mobos-12.html.
    That's the file "sock7_mobos-12.html" in the folder "19980731" in the folder
    "motherboard" in the folder "www.de.tomshardware.com" in the folder you
    unzipped the file into. The path to the file is not documented once the
    archive is unzipped. Now go find that file.
    Plus, they store the path to other items in a strange way (probably the
    original URL), not a relative file path, so the saved and unzipped pages
    will display without the graphics etc. (and maybe even without the inner
    frame that contains the relevant information).
    I really dislike they did that. They even advertise the zip archive format
    and its portability, which I consider a broken promise from the start.
    OTOH, Mozilla (when it's working) will save the starting point file under a
    name you choose (and append ".html" automatically) and all other items are
    stored in a "..._files" folder besides the main file. That's pretty much the
    way IE stores complete web pages under Windows (unfortunately not on the
    Mac) and the most compatible and portable way I could think of.
    And btw if you're in any way affiliated with iCab or to any one of them who
    is listening: Please change hat!
    Or, if you can, introduce a "Save as really universally compatible ZIP
    archive" mode as an option.
    Or, if I missed the boat here in some way, please let me now.
    Probably there would be a way to restructure the unzipped archives
    (AppleScript?), but I have no time to learn that in the near future (no time
    for that). And we're talking about thousands of files herem so I need an
    easy and effortless method.

    Alex
     
    Alex Wenzel, Apr 19, 2004
    #10
  11. Alex Wenzel

    Alex Wenzel Guest

    Matt,

    I really like your work for the Mac community, and in fact, some tidbits
    articles were part of the reason why I got interested in Macs (starting only
    3 years ago - Macs are even less common here in Germany than in the US, I
    knew nothing but PCs before), esp. older Macs (thanks to archives like
    tidbits', Low End Mac's and others).
    But what you're doing here is not nice:
    "I could find out what you need and tell you in less than a minute. But I
    won't. Buy my book."
    Some people have no time to take their hobby (if it were a profession, it
    would be a different matter) to those heights. I am not a programmer and I
    will probably never become one. Especially now I don't have the time to
    learn a programming language. Even if I'd like to (I would).
    I hoped that someone would tell me the precise code I need, or give me
    detailed instructions step-by-step-wise. Again, I don't have the time to
    find it out the hard way.
    Although time is not an issue when it comes to how long a script will run (I
    do sleep sometimes, too), time is an issue when it will take me weeks to
    build the script.

    BTW (maybe I would even buy the book, but not now, maybe half a year from
    now, when I have more time): Is the content of your book also usable for
    pre-OS X users?

    Regards,
    Alex
     
    Alex Wenzel, Apr 19, 2004
    #11
  12. Alex Wenzel

    matt neuburg Guest

    No, that's not what I was doing. You seemed not to know what AppleScript
    *is*. Well, if you're curious about it book is a way to find out. But
    it's certainly not the only way, and it certainly needn't cost you any
    money to find out.

    The part about "I could write a script" was simply to confirm that this
    is indeed a way to solve the problem you pose, and that it is quick to
    implement (though, as someone pointed out, not to execute). But this is
    not necessarily the way you will in fact solve this particular problem
    on this particular occasion. Nothing wrong with that, either. m.

    PS If you were on Mac OS X, AppleScript probably isn't how I'd solve it
    either.
     
    matt neuburg, Apr 20, 2004
    #12
  13. Alex Wenzel

    Alex Wenzel Guest

    Wow, that was a quick response.

    Sorry, didn't want to become too offensive.
    I know what AppleScript is. I use some (simple) predefined AppleScripts I
    dl'd from somewhere. I'd love to learn some mighty scripting language to do
    tedious tasks that impose unsurmounteable problems otherwise. I just don't
    have the time for that.
    Your book seems to be pretty good (regarding the reviews it got, and what I
    read from you, anyway).
    So you won't offer me a precise solution for this particular problem? Please
    please please (unfortunately, it's too late now for me to pretend being a
    well-built female - damn).
    So how would I solve it on OS X? I could boot into OS X (1.2.8) for this
    particular task (although I dislike OS X so much - not the innards, but the
    GUI - that I never use it, although I bought it, plus Office X).

    Regards from Germany,
    Alex
     
    Alex Wenzel, Apr 20, 2004
    #13
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.