# Detecting Inline Attachments in Mail

Hi!

is it possible to detect the position of inline attachment in Mail.app? Like certain paragraph number or something?

I was thinking of consolidating 2 or more mails into a single mail, one after another.
I’ve done the text part, now attempting the attachment part.

thx
yyt

maybe i wasn’t very clear with my qn…

I was thinking whether it’s possible to detect the position of the attachment of the 1st mail message and it returns the paragraph number, say paragraph 10. Paragraph 1-9 are all text
Next, I’ll detect the position of the attachment in the 2nd mail message, and say it returns paragraph 15, paragraph 1-14 are all text.

Finally, I’ll structure an outgoing mail and insert the
text of the first mail
then the attachment of the first mail in paragraph 10 of the outgoing mail,
and the text for the second mail,
then paragraph 25 of the outgoing mail.

Is it possible to do this?

Hi,

does the position of the attachment really matter?

I think, the only way to detect the position of the attachment is to parse the source of a mail

For me it does, as I’m combining 2 messages into 1…so let’s say if the attachment of the 1st message is a picture, it gets terribly out of sync (and thus doesn’t make sense) in the final combined message.
And the other problem is that the attachments in the final message would have to be re-labelled individually (like probably by sender) so that they show previously which message they belong too.

So I was hoping that if i know which paragraph it belongs too, i might be able to work out an algo to re-insert it to the right para in the final combined message.

Thanks for your suggestion, I’ll look into parsing the source of the mail.