1 2 Previous Next 19 Replies Latest reply: Nov 8, 2010 6:37 PM by KXsig
liam27 Level 1 Level 1 (65 points)
I'm wondering how to search inside bundles (.app, .mpkg, etc...). When, for example, I do a search for "Kind: Applications" in the Finder, I get lots of results (including system files, which I added as a search attribute), but nothing inside another application or bundle. How do I do this?

13" MacBook Pro, Mac OS X (10.6.4)
  • 1. Re: Spotlight/Finder search inside bundles?
    varjak paw Level 10 Level 10 (169,765 points)
    I don't believe that Spotlight can search inside bundles/packages. Try the freeware EasyFind. It can search within packages.

    Regards.
  • 2. Re: Spotlight/Finder search inside bundles?
    KXsig Level 2 Level 2 (305 points)
    Hi there,

    I dispose a MDImporter called Ziplight that is supposed to allow indexing and searches inside ZIP files, but to be honest I have it for a while and never got any search results from inside a ZIP file.
    Try to look for a mdimporter that claims to do this you wish.

    Good luck.
  • 3. Re: Spotlight/Finder search inside bundles?
    liam27 Level 1 Level 1 (65 points)
    Thanks, EasyFind seems to work pretty well, a couple questions however... QuickLook!? It doesn't seem to work for me... in the manual it says it should work for 10.5, which I assumed meant it would work for 10.6.4 also... It searches inside bundles perfectly, but can I make it search for only one type of file? For example, .app bundles? Or .icns files?
  • 4. Re: Spotlight/Finder search inside bundles?
    KXsig Level 2 Level 2 (305 points)
    Hi L,

    As you mentioned ICS files I remembered building a 10.000 icons collection from icons that existed on my Mac using the Unix command find combined with sudo and copy.

    If you were willing to make something like this rather then constantly searching for items then an operation like this one I did could be better.

    Good luck.
  • 5. Re: Spotlight/Finder search inside bundles?
    liam27 Level 1 Level 1 (65 points)
    Ah yes that's a good idea. However, I'm really just looking for the ICNS that have been upgraded to 512x512 pixels...
  • 6. Re: Spotlight/Finder search inside bundles?
    KXsig Level 2 Level 2 (305 points)
    Hi there,

    Here is the command, after collecting all ICNS you can use Finder's search options to isolate files that do NOT have 512 pixels wide and REMOVE items.

    sudo find /Applications/ /Library/ System/ /OtherPathsYouWant/ -name "*.icns" -exec sh -c 'exec cp "$@" /Users/YourUserName/FolderTo_icns512/' find-copy {} +

    You need to use SUDO so you won't have any permission denied bumps, you need to specify the paths to search instead of using the root "/" only so you won't bump into devices directories errors.

    Do you know how to perform the Finder's 512 pixels wide search?

    Good luck.
  • 7. Re: Spotlight/Finder search inside bundles?
    liam27 Level 1 Level 1 (65 points)
    Thanks! That's great! However...
    This is the command I used:

    sudo find /Applications/ /Library/ /System/ /Users/ /Developer/ -name "*.icns" -exec sh -c 'exec cp "$@" /Users/liam/Pictures/Terminal_ICNS/' find-copy {} +

    I assume you meant to put a / before System as well?

    I pressed enter, and... nothing happened. Above is exactly what I typed... Why didn't it do anything?
  • 8. Re: Spotlight/Finder search inside bundles?
    KXsig Level 2 Level 2 (305 points)
    Hi L,

    Sorry for the missing bar for System!

    Strange behavior is what you got.

    Log in with you Admin account, you can do that in Terminal using the command line "login" when you will be prompted for user name and password (after finishing shell interaction, logout from Admin account with the command line "exit" - this logout is mean to be used as default for any shell interaction). As Admin try using the find without the sudo and the copy, like:
    find /Applications/ /Library/ /System/ /Users/ /Developer/ -name "*.icns"

    If you have items listed, even with some access denied messages, then append the copy instruction. Check the copied files existence, if they were there do the simple find again but insert the sudo - this should ask for your user password (not the root password); from here the same as before, getting listing append the copy instruction.

    If sudo do not work check for log entries in your /var/log/auth.log and bring those entries here.

    Good luck.
  • 9. Re: Spotlight/Finder search inside bundles?
    liam27 Level 1 Level 1 (65 points)
    Sorry about that, it actually did do something. Just not for the first 3 minutes. Good thing I left the window open!

    Yes, it found all the ICNS files, and I filtered them in the Finder. One question: it seemed to have found everything in the Users, Library, System, Applications, and Developer folders, but what about the ICNS (if there are any) in the invisible folders (/.NameofFolder)?
  • 10. Re: Spotlight/Finder search inside bundles?
    KXsig Level 2 Level 2 (305 points)
    Hi L,

    They are there too! The find tool went till the end of every directory, inside bundles and protected items. You are done!

    Great to know! Cheers, K.

    You could do the same for PNG (a lot of), ICO and ICN too.

    Message was edited by: KXsig
  • 11. Re: Spotlight/Finder search inside bundles?
    liam27 Level 1 Level 1 (65 points)
    But if, for example, I only had one visible folder (say, "System") at /, and I told it to find ICNS inside System, why would it search inside the other invisible folders at /? It seems that it would search inside invisible folders at /System/, but not invisible folders at /. Is this correct? And if so, how could I search inside those also?
  • 12. Re: Spotlight/Finder search inside bundles?
    KXsig Level 2 Level 2 (305 points)
    Hi L,

    The command find descends the specified directory tree recursively and by default the period started names of files and directories are included. That is why it would search inside the Finder's invisible items.

    All directories in the mounted device volume have an item "." and another ".." the "." item refers to itself and the ".." refers to parent. The find search go into the ".any_character" item but not into the "." item or ".." item, as a security default.

    Is this "/System/." item you meant?

    Regards, K.
  • 13. Re: Spotlight/Finder search inside bundles?
    KXsig Level 2 Level 2 (305 points)
    Hey L,

    I think that maybe I misunderstood your question. You asked if you set a find command to start at the Volume root - the / - the /System results would be target? If so, the answer is yes, this way the hole volume content would be reached, but the reason to avoid this is that when find reaches the directory in which you were copying the files the work would be done again.
    We could also use find arguments specifying no entrance in the saving directory, I never used this argument, if you wish take a look at the find manual page.

    Cheers, K.
  • 14. Re: Spotlight/Finder search inside bundles?
    liam27 Level 1 Level 1 (65 points)
    Ah, yes, I see what you mean, but I searched inside /Users, and the folder where I was copying the icns too was /Users/liam/Pictures/ICNS... and it seemed to work fine. ???

    My question was this:

    When I searched, I searched inside /System, /Developer, /Users, /Library, and /Applications. It seems to me that, because I did not do a search inside the root directory ( / ), the invisible folders IN the root directory (for example, the .Trashes folder) would not be searched. Is this correct?
1 2 Previous Next