How do I find and extract images in from email

Over the years, plenty of people have shared pictures with me via email. I want to find all those pictures and make copies to put into aperture. I don't want to grab all the pictures that are .gifs that are icons from applications or signature etc.

Does anyone know a good way or app to do this? Finder doesn't seem to allow me to exclude certain files.

Posted on Jan 29, 2012 2:26 PM

Reply
12 replies

Jan 30, 2012 2:05 PM in response to mass

One way would be to download and install the freeware EasyFind which you can find here:

http://www.devontechnologies.com/products/freeware.html


Then use it to specifically search your "Mailboxes" folder that is located deep in the heart of your Mac. It should be found in your main mard drive > Users > "User Account"(whatever that may be) > Library > Mail.


Inside that folder you'll find all your email attachments. BE CAREFUL not to move anything around or remove any of these files, but it is safe to COPY a file out of there.


Then you could set up your serach criteria to find any files with the .jpg (or whatever) that you are looking for (make sure it is searching invisable files) and once found, COPY them out of the found location. You can just option-drag them out of the found list to make copies.

Jan 30, 2012 11:25 PM in response to mass

mass wrote:


Over the years, plenty of people have shared pictures with me via email. I want to find all those pictures and make copies to put into aperture. I don't want to grab all the pictures that are .gifs that are icons from applications or signature etc.

Does anyone know a good way or app to do this? Finder doesn't seem to allow me to exclude certain files.


Please clarify this. Are these pictures you extracted from the emails and placed some where and you want to find them? Or do you think Mail.app squirreled away some place for your to find? If it the latter you won't be able to find them because they are embedded in the .emix corresponding to a message?

Jan 31, 2012 12:35 AM in response to X423424X

I think Mail or Outlook keep the files inside others.

X1 indexes everything on the PC and then let's you search for files and see previews and then extract or move etc.

Basically, people have sent me emails over the years with attached photos and images. i'd like to find all those and move/copy them to Aperture.

Thanks

Jan 31, 2012 12:53 AM in response to mass

I think Mail or Outlook keep the files inside others.

. . .

i'd like to find all those and move/copy them to Aperture.



I don't know about Outlook but I experimented with some attached images in mail.app and it embeds the image in the .emix file containing the message. They exist no place else unless you dragged them out of the message to someplace.

Jan 31, 2012 3:10 PM in response to mass

mass wrote:


Finder doesn't seem to allow me to exclude certain files.

Let's get a few things out of the way first.


As to X1, forget it. It's Windows only, and it's not exactly cheap.


Also, nothing I say applies to Outlook. I assume you're talking Outlook 2011, and I have no clue how it works.


As to Finder, it doesn't do searches. All searches are done by Spotlight. Finder's Find command, the Spotlight menu, these are just different ways of interacting with Spotlight. And, yes, of course you can exclude certain files. You simply have to learn to use Spotlight. I'm not a fan -- I think Spotlight is not a search engine, but a sorry, pathetic excuse for one -- but still, it can do a few things if you handle it right.


Now, about Mail. AFAIK, Apple does not document the <~/Library/Mail> structure, so what follows is from my own observations, and hence not authoritative.


Incoming and outgoing messages from your mail accounts, ie, listed in Mail.app's Sidebar under "Mailboxes", are stored in <~/Library/Mail/[account]>, inside .mbox packages, as individual .emlx files. An .emlx file contains the raw message, plus an XML footer. Any attachments are, of course, inside the raw message in base64 encoding. The .emlx metadata does not include whether or not the message contains an attachment, so you can't use Spotlight to search for messages with attachments, nor can you do that in Mail.


However, messages which are moved from your mail accounts to local, user-created mailboxes, listed in Mail.app's Sidebar under "On My Mac", are treated slightly differently. They are still stored as .emlx files (including attachments) inside .mbox packages, which, in their turn, are inside a directory named "Mailboxes", but the attachments are also extracted to an Attachments directory inside the respective .mbox package, being stored inside directories labelled with the respective message's number. With this arrangement, finding images with Spotlight becomes trivial.


For instance, you say you want to find all images which are not GIFs. In Finder, select <~/Library/Mail/Mailboxes>, then ⌘F or ⇧⌘F. In the search field, type


kind:image NOT .gif


(the Boolean operator NOT is case sensitive). This should find all images which do not contain the string ".gif" in their file name. Of course, there are strings attached. If there is an image named, say, "my_photo.gif.jpg", it will be missed. Also, "kind:image" only looks for TIFF, JPEG, PNG, GIF and BMP formats. It will probably not find RAW images, or those in more exotic formats.


So, your first step in Mail (if you haven't done so already) is to organise your mail, irrespective of attachments, in mailboxes and folders in "On My Mac". (IMHO, this is a good idea in any case.)


The next step is to use a Spotlight search as described above to find all images. After that, it's up to you. I don't know how Aperture works. Maybe you can just import them, or maybe you need to copy them to some folder. (Remember, you may copy stuff from <~/Library/Mail>, but don't move or delete any of it in Finder -- or the wrath of Mac OS X will strike down upon thee with great vengeance and furious anger!) If you do need to copy them to some other folder, I suspect you'll discover another bridge to cross, but we'll deal with that when -- if -- we get there.

Feb 2, 2012 1:18 AM in response to fane_j

fane_j- this is a very helpful answer. It's annoying there isn't an app that can do this more simply. A couple of further questions if I go down the Spotlight route:

1- how do i exclude certain folders in spotlight? for example, i want to search for all images that are not in my aperture library

2- Assuming i've found all of them, how can i simply go through them to select the ones i want to move/copy to my library. For example, do i have to copy all of them to a new folder and then go through one by one and get rid of all those annoying little icons and app images?

3- your last point- how do i copy them to a new folder.

4- how do i find Raw images too- do i simply add OR ".RAW"?


Thanks again for your great post.

Feb 7, 2012 10:12 PM in response to mass

mass wrote:


1- how do i exclude certain folders in spotlight?

I don't know how to exclude a specific folder from a Spotlight query. (I told you IMHO Spotlight was crap!) It is possible to exclude folders and disks from Spotlight indexing, using the Privacy tab, but that means they'll be excluded from all Spotlight queries.


However, in this specific instance, you don't have to. If you do as I wrote above, ie, select <~/Library/Mail/Mailboxes>, then ⌘F or ⇧⌘F, you get the option to search just the Mailboxes folder, rather than "This Mac".

2- Assuming i've found all of them, how can i simply go through them to select the ones i want to move/copy to my library. For example, do i have to copy all of them to a new folder and then go through one by one and get rid of all those annoying little icons and app images?

That depends on what you do and what Aperture requires. As I told you, I don't know anything about Aperture, so you'll have to figure out that for yourself. But, remember, you may copy items stored in <~/Library/Mail>, but you shouldn't modify them.

3- your last point- how do i copy them to a new folder.

Well, the command is simple enough -- select all, then either ⌥-drag them to the target, or ⌘C, then ⌘V in the target. The problem is that, very likely, you'll have different files with the same name. That works in <~/Library/Mail/Mailboxes/>, because they're stored in different folders, but copying them to the same folder won't work. The best solution to the problem is to write an AppleScript script which does the copying, checking first if a file by that name exists and, if yes, renaming the file being copied.

4- how do i find Raw images too- do i simply add OR ".RAW"?

No. And there's just no easy way to find them; see this Wikipedia entry


<http://en.wikipedia.org/wiki/Raw_image_format>


Probably the best thing to do is simply to ignore the issue. Think of it this way: the file types subsumed by Spotlight under the "image" kind represent probably 90% or even 99% of all pics your correspondents ever sent you. Is spending days trying to figure out a way of importing the remaining 1% worth it?

Any chance you can answer the follow up questions I had?

Sorry it took so long. Unfortunately, I'm not yet in a position to dedicate all my time to pleasure -- sometimes business, and even family, matters do intrude…

Feb 8, 2012 10:51 AM in response to fane_j

I just realised that the Outlook thing wasn't working. But also, I tried the Mail idea you suggested and it doesn't seem to be able to read the images in the mailboxes. I am definitely selecting mailboxes that are "on my Mac". The files are .mbox and inside are .emlx but neither seems to get searched for the image attachments. Any ideas?

Feb 8, 2012 5:30 PM in response to mass

mass wrote:


the Outlook thing wasn't working.

As I said, I know nothing about Outlook.

I tried the Mail idea you suggested and it doesn't seem to be able to read the images in the mailboxes. I am definitely selecting mailboxes that are "on my Mac".

Just to be clear. You are, are you not, doing this search in Finder, as I wrote above


"For instance, you say you want to find all images which are not GIFs. In Finder, select <~/Library/Mail/Mailboxes>, then ⌘F or ⇧⌘F. In the search field, type


kind:image NOT .gif


(the Boolean operator NOT is case sensitive). This should find all images which do not contain the string ".gif" in their file name."

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I find and extract images in from email

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