How do I "bulk" export all Voice Memos from app on OS X
Hello!
I've seen this question asked here a few times and I've never found a good answer. I've got hundreds of voice memos that I've named very intentionally, and I'd like to have them as audio files in Finder. I can locate the source files in Finder, but the filenames are obfuscated and don't match the ones I've set. Alternatively, I can drag each file one-at-a-time, which takes a full day with over 1,000 voice memos, and it also overwrites the creation date (which is important for my records).
Until Apple implements a better export feature, I'd like to offer my solution in the form of a Bash script:
#! /bin/bash
db = "~/Library/Application\ Support/com.apple.voicememos/Recordings/CloudRecordings.db"
mkdir "AllVoiceMemos"
cd "AllVoiceMemos"
OIFS=$IFS
IFS='|'
sqlite3 ~/Library/Application\ Support/com.apple.voicememos/Recordings/CloudRecordings.db "SELECT ZPATH, ZCUSTOMLABEL, ZDATE FROM ZCLOUDRECORDING" | while read line; do
thisline=($line)
location=${thisline[0]}
name=${thisline[1]}
date=${thisline[2]}
offset="978307200"
newdate=$(bc <<< "$date+$offset")
trimdate=${newdate%.*}
formatteddate=$(date -r $trimdate +%y%m%d%H%M.%S)
echo "Location: $location. Name: $name. Date: $date. New Date: $newdate. Trimdate: $trimdate. Formatted: $formatteddate"
cp $location "./$name.m4a"
touch -a -m -t $formatteddate "./$name.m4a"
done
IFS=$OIFS
- First, make sure your voice memos are sync'd to iCloud (make sure this is enabled first in System Preferences > Apple ID > iCloud Drive (click options) > Check box next to Voice Memos)
- Simply save this to a file and name it "export.sh" (or whatever name you'd like). Place the file in whatever directory you'd like the voice memos to appear in, then run it in terminal with "bash export.sh".
This script will crawl through the CloudRecordings.db SQLite database and copy each file from the system directory, preserving your original name and the date it was recorded.
I realize this is technically more of an "answer" than a question, but I wasn't able to reply on the other threads. Feel free to advise if there's a better place for this. Hopefully it helps!
MacBook Pro 15″, macOS 10.13