How do I "bulk" export all Voice Memos from app on OS X? - Ventura Update

Why is it so hard to bulk export all Voice Memos? Sure, you can drag them out of the app to your Desktop one by one. This retains the title, but it is creating a new file, thus losing the original date stamp of when it was recorded. The original date stamp is very pertinent information for most people.


In response to the post by bencollins2 here: https://discussions.apple.com/thread/253230259?


The bash script did not initially work for macOS Ventura as the Voice Memos location has moved.


The updated path for Ventura is:


~/Library/Containers/com.apple.VoiceMemos/Data/Library/Application\ Support/Recordings/CloudRecordings.db


So updating "bencollins2" original script with this path will work. See below. Thank you BenCollins2!!


#! /bin/bash

db = "~/Library/Application\ Support/com.apple.voicememos/Recordings/CloudRecordings.db"

mkdir "AllVoiceMemos"

cd "AllVoiceMemos"

OIFS=$IFS

IFS='|'

sqlite3 ~/Library/Containers/com.apple.VoiceMemos/Data/Library/Application\ Support/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



Posted on Nov 30, 2023 11:56 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 27, 2024 11:19 AM

they moved the cloud recording DB on sonoma so here's an update:


(also I had to go into security setting, full disk access, and allow my terminal program access urgh)


#!/bin/bash


# Define the base directory for the voice memo recordings

db="$HOME/Library/Group Containers/group.com.apple.VoiceMemos.shared/Recordings/"


# Create a directory for all voice memos

mkdir -p "AllVoiceMemos"

cd "AllVoiceMemos" || exit


# Save the original IFS and set a new one

OIFS="$IFS"

IFS='|'


# Query the SQLite database and process each line

sqlite3 "${db}CloudRecordings.db" "SELECT ZPATH, ZCUSTOMLABEL, ZDATE, ZENCRYPTEDTITLE FROM ZCLOUDRECORDING" | while read -r line; do

# Split the line into an array

read -ra thisline <<< "$line"

relative_location="${thisline[0]}"

name="${thisline[3]}"

date="${thisline[2]}"

offset="978307200"

# Calculate the new date

newdate=$(bc <<< "$date+$offset")

trimdate=${newdate%.*}

formatteddate=$(date -r "$trimdate" +%y%m%d%H%M.%S)

# Construct the full path to the file

full_location="${db}${relative_location}"

# Print the details (optional, for verification)

echo "Full Location: $full_location. Name: $name. Date: $date. New Date: $newdate. Trimdate: $trimdate. Formatted: $formatteddate"

# Copy the file to the new location and rename it

if [ -f "$full_location" ]; then

cp "$full_location" "./$name.m4a"

# Update the access and modification times

touch -a -m -t "$formatteddate" "./$name.m4a"

else

echo "File not found: $full_location"

fi

done


# Restore the original IFS

IFS="$OIFS"



Similar questions

2 replies
Question marked as Top-ranking reply

Feb 27, 2024 11:19 AM in response to gboggs

they moved the cloud recording DB on sonoma so here's an update:


(also I had to go into security setting, full disk access, and allow my terminal program access urgh)


#!/bin/bash


# Define the base directory for the voice memo recordings

db="$HOME/Library/Group Containers/group.com.apple.VoiceMemos.shared/Recordings/"


# Create a directory for all voice memos

mkdir -p "AllVoiceMemos"

cd "AllVoiceMemos" || exit


# Save the original IFS and set a new one

OIFS="$IFS"

IFS='|'


# Query the SQLite database and process each line

sqlite3 "${db}CloudRecordings.db" "SELECT ZPATH, ZCUSTOMLABEL, ZDATE, ZENCRYPTEDTITLE FROM ZCLOUDRECORDING" | while read -r line; do

# Split the line into an array

read -ra thisline <<< "$line"

relative_location="${thisline[0]}"

name="${thisline[3]}"

date="${thisline[2]}"

offset="978307200"

# Calculate the new date

newdate=$(bc <<< "$date+$offset")

trimdate=${newdate%.*}

formatteddate=$(date -r "$trimdate" +%y%m%d%H%M.%S)

# Construct the full path to the file

full_location="${db}${relative_location}"

# Print the details (optional, for verification)

echo "Full Location: $full_location. Name: $name. Date: $date. New Date: $newdate. Trimdate: $trimdate. Formatted: $formatteddate"

# Copy the file to the new location and rename it

if [ -f "$full_location" ]; then

cp "$full_location" "./$name.m4a"

# Update the access and modification times

touch -a -m -t "$formatteddate" "./$name.m4a"

else

echo "File not found: $full_location"

fi

done


# Restore the original IFS

IFS="$OIFS"



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I "bulk" export all Voice Memos from app on OS X? - Ventura Update

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.