Skip to content

Instantly share code, notes, and snippets.

@bgulla
Created June 25, 2019 15:20
Show Gist options
  • Save bgulla/b217ab682ae5d0bc35c73838c0c28105 to your computer and use it in GitHub Desktop.
Save bgulla/b217ab682ae5d0bc35c73838c0c28105 to your computer and use it in GitHub Desktop.
Dumps all images from iMessages.
import os
import shutil
mkdir ~/Desktop/imessage
rootDir = "/Users/${USER}/Library/Messages/Attachments"
destDir = "/Users/${USER}/Desktop/imessage"
IGNORE_STRING = "pluginPayloadAttachment"
for dirName, subdirList, fileList in os.walk(rootDir):
#print("Found directory: %s" % dirName)
for fname in fileList:
if IGNORE_STRING in fname:
print("skipping: \t%s" % fname)
continue
print("\t%s" % fname)
src_fp = os.path.join(rootDir, dirName,fname)
dest_fp = os.path.join(destDir, fname)
shutil.copy2(src_fp, dest_fp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment