Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Spotlight/Finder search inside bundles?

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)

Posted on Aug 13, 2010 12:44 PM

Reply
19 replies

Aug 14, 2010 6:25 AM in response to varjak paw

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?

Aug 14, 2010 12:49 PM in response to liam27

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.

Aug 15, 2010 4:57 PM in response to liam27

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.

Aug 23, 2010 1:22 PM in response to KXsig

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?

Aug 23, 2010 3:47 PM in response to liam27

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.

Aug 23, 2010 6:52 PM in response to KXsig

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)?

Aug 24, 2010 1:42 PM in response to KXsig

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?

Aug 24, 2010 3:43 PM in response to liam27

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.

Aug 24, 2010 8:55 PM in response to liam27

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.

Aug 25, 2010 1:51 PM in response to KXsig

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?

Spotlight/Finder search inside bundles?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.