Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Contact Details Not Resolving, Phone Number Only #62

Closed
DevMan01 opened this issue Jan 16, 2023 · 5 comments
Closed

Contact Details Not Resolving, Phone Number Only #62

DevMan01 opened this issue Jan 16, 2023 · 5 comments
Labels
wontfix This will not be worked on

Comments

@DevMan01
Copy link

When I run:
imessage-exporter -f html -o /Users/...

The tool successully exports and builds the export, with one exception - All of HTML files, and chat mentions are titled or addressed using individuals phone numbers, and not their contact name in the MacOS Contacts.

Is this a bug? User error? Or a feature that needs to be developed?

@ReagentX
Copy link
Owner

ReagentX commented Jan 16, 2023

This software interacts with the iMessage database only; contacts are not stored inside of it. This tool only targets features that are directly related to the iMessage tables.

@ReagentX ReagentX closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2023
@paulasyn
Copy link

@DevMan01 not really a direct solution but you can try making this a script to run through all your conversations with numbers and possibly have success with this?

https://apple.stackexchange.com/questions/72652/contacts-app-command-line-interface

@PhilMac
Copy link

PhilMac commented Mar 23, 2023

Such an ability would make this tool so much more useful to me—I get that this software itself will only access the iMessage database, but if someone were to write a script using the tool @paulasyn mentioned it would be awesome. (A pity I don't have the skills to do it myself!)

@bdillahu
Copy link

bdillahu commented Dec 22, 2024

Such an ability would make this tool so much more useful to me—I get that this software itself will only access the iMessage database, but if someone were to write a script using the tool @paulasyn mentioned it would be awesome. (A pity I don't have the skills to do it myself!)

I know this is was late, but I cobbled this script up and it's worked for me... no guarantees, but if it helps anybody:

cd ~/imessage_export/

# path to the contacts tool from https://github.com/shanecelis/contacts

# I'm replacing any number that I find in my contacts with the full name of the contact and the number in parens ()
# build table of sed commands
# dumps entire contacts database names (%n) and mobild number (%mp)
# the first gsub removes "-", "(", ")", " ", or "+1" (at the start of the string
# the second gsub removes trailing spaces from the names field
# if there is a mobile number in field $2
# the print command forms the sed command structure
# dumps table into repl.sed temp file

~/tools/contacts/contacts -H -l -f "%n:%mp" | awk -F: '{gsub(/-|\(|\)| |^\+1/, "", $2); gsub(/[ \t]+$/, "", $1); if ($2) print "s|<span class=\"sender\">+1"$2"</span></p>|<span class=\"sender\">"$1" (+1"$2")</span></p>|g"}' > repl.sed

# run sed against the file passed in
find ~/imessage_export -type f -maxdepth 1 -name "*.html" -exec sed -f repl.sed -i '' {} \;

# clean up temp file
rm repl.sed

@johnburnett
Copy link

Thanks for this awesome tool, @ReagentX! On the outside chance it's useful to someone... I have a personal Python script for wrangling contact information, and I just added a feature to update the imessage-exporter files with contact info pulled from a collection of vCard files. It's in this repo, added in this commit. I don't expect it to be directly usable by anyone, but it points a possible direction to go for other tools.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

6 participants