Is there a way to save items from the Messages app to DEVONthink?

Is there a way to save items from the Messages app to DEVONthink?

Just drag and drop them from Messages into DEVONthink.
You can also click the Details link at the top of the thread and isolate the attachments for dragging and dropping.

You sure about that?

I cannot drag/drop from Messages

I’d love to know what I am doing wrong - this would be a nice feature if it were possible.

Not only am I sure about it, I do it often :slight_smile:

And I’m referring to the attachments, not the messages. Those are a different matter and can’t be dragged and dropped.

Well, where there’s a will and baling wire, there might be a way.

Select a message thread in Apple Messages. In Messages, use File->Print.

On the bottom left of the right-hand pane of the print preview dialog box, use the drop-down menu that defaults to PDF to choose “Save PDF to DEVONthink 3.”

That will put the whole conversation thread in a PDF in your Inbox. The text in the PDF is just text, so it’s searchable.

Does that help? I can’t find a way to do more than one conversation at a time, but perhaps there’s an Applescript trick that might be useful.

4 Likes

Ahh… that makes sense - thank you for the clarification

My original question was whether there was a way to import messages into DEVONthink. I was hoping there might be a way to drag and drop individual messages, as well as entire conversation threads, but I don’t see any way to do that. Selecting an entire conversation thread and printing it as a PDF to DEVONthink DOES work, so that’s at least of some help. And yes, it does seem to be possible to drag and drop attachments to messages into DEVONthink; that may be of some help to others, and might be helpful to me in the future, but not quite what I was looking for.

So, I appreciate all the feedback, but would like to see a feature added to DEVONthink that would permit importing even a single message, or selected groups of messages, into DEVONthink. Bluefrog, maybe you could pass that along to the right folks at DEVONtechnologies!

Randy

To my knowledge, Messages has very limited export options, which is frustrating.

Screenshotting and saving the screenshot to DT might be an option. It’s what I do with my task manager when I need to remind myself to reply to or otherwise take action on a message.

1 Like

Print and then Save PDF to Devonthink 3 will also work from Apple Reminders or anything that supports printed output.

TaskPaper has an Import Reminder Copies function that will grab a copy of your Apple Reminders tasks in text format. That can be handy, too.

2 Likes

How about this (if you are working on MacOS):

  • CMD-Shift-4 then select the area of the conversation which you want to capture.

  • In the correct database/group in DT3 do Data > New > With Clipboard.

This captures the selected messages as an image. Stop here if you don’t need it searchable, otherwise:

  • Right-click on the newly captured file. Select OCR > To Comment.

Of course the OCR process can be automated using a Smart Rule.

I use this method to capture internet forms that I have filled (such as registration forms) where printing to PDF does not work.

HTH!

Thanks! This does just what I need. I didn’t think about this trick, even though I often use the Save PDF to DEVONthink trick for archiving other kinds of documents to DEVONthink!

Randy

1 Like

Hi Randy, the other thing to remember is the services menu, which means anything you select can be assigned a short cut menu and brought into DT. Or without assigning a shortcut, select the text, control click and select services.
You configure the service menu in system settings>keyboard services>text. It can capture text in just about any application and DT has a bunch of options in there.

2 Likes

That’s a really nice one - love it!

I’ve made a Python program what will:

: import the chatdb.db database on macOS that holds all Apple Messages

: then outputs to a text files summary statistics about those mesages, ready for import into DEVONthink.

: Optionally will create individual files for each individual text messages which can then be imported or indexed into DEVOthink

Doesn’t have all the bells and whistles, but enough to get going for anyone slightly informed about Python, and if not, perhaps a first stab at entering that world.

Example of the summary output:

# Messages Summary Statistics

Chat.db file location: /Users/YOURHOMEDIR/Library/Messages/chat.db

Start Date: Not Specified
End Date:   Not Specified
Limit_Head_Rows_in_Extract: Not Specified

Earliest Message: 2022-07-18 06:58:45
Latest Message:   2023-07-27 08:51:29

## Messages Sent by Me
is_sent       0
---------  ----
No         3835
Yes        4043

## Messages Sent by Me by Year and Month
              No    Yes
----------  ----  -----
(2022, 7)     57     60
(2022, 8)    332    390
(2022, 9)    337    400
(2022, 10)   257    247
(2022, 11)   263    279
(2022, 12)   187    186
(2023, 1)    241    277
(2023, 2)    281    279
(2023, 3)    322    365
(2023, 4)    407    444
(2023, 5)    268    321
(2023, 6)    524    469
(2023, 7)    358    327

## Messages by Year Sent by Me
  year    No    Yes
------  ----  -----
  2022  1433   1562
  2023  2401   2482

## Messages by Service Sent by Me
service      No    Yes
---------  ----  -----
SMS          49     35
iMessage   3785   4009

## Messages by Phone Number Sent by Me
phone_number                                    No    Yes
--------------------------------------------  ----  -----
'zz'                                             2    nan
+xxxxxxxxxx                                   nan      1
+xxxxxxxxxx                                    56     68
...AND A WHOLE LOT MORE IF YOU WANT

Example of file created for individual message

Filename : /Users/YOURPROFILE/desktop/indfiles/Apple Message 29711.html
Message ID : 29711
subject : None
phone_number : +XXXXXXXXX
service : iMessage
is_from_me : No
is_delivered : Yes
is_read : No
date : 2022-07-21
timestamp : 2022-07-21 21:24:02
month : 7
year : 2022
is_sent : No
body : Mum tried to call but was busy at work

The python program attached in zip form, which holds the Python script, a Jupyter notebook, and a PDF of the Jupyter notebook.

AppleMessages_Export.zip (113.9 KB)

May or may not work for you.

Ah, very nice workaround and it works, thanks!

I had to adjust two minor things to get it working for me (maybe due to german locale):

  • Add escape chars for csv export:
 df_messages.to_csv(output_folder + 'df_messages.csv', index = False, encoding='utf-8')
    df_messages_extract.to_csv(output_folder + 'df_messages_extract.csv', index = False, encoding='utf-8')

—>

df_messages.to_csv(output_folder + 'df_messages.csv', index = False, encoding='utf-8', escapechar='\\')
    df_messages_extract.to_csv(output_folder + 'df_messages_extract.csv', index = False, encoding='utf-8', escapechar='\\')
  • Move the db-file to the desktop to process it. I assume it’s some issue with permission. Having them on the Desktop is not a solution but will help to find out whether the script works for you or not. I’ll have to see how to automate this and it may also be an issue for me anyways.

Nice that you report it works. Thanks. I did not notice need for escape characters as the files worked in both Numbers and DEVONthink without them—so did not pursue. But glad it helps you. I write temp stuff I am working on to Desktop so that when I forget about it and the stuff still there I notice and then handle (delete). can use any folder for output. the program does not care as long as you specify it with a trailing forward slash.