Created
July 14, 2023 15:55
-
-
Save pierwill/53a38deb2f649a2843035958e455b0f6 to your computer and use it in GitHub Desktop.
Export all iCloud voice memos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
newdir="allvoicememos" | |
mkdir $newdir | |
cd $newdir | |
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 New filename: $newfilename" | |
newfilename="./$name-$trimdate.m4a" | |
cp $location $newfilename | |
touch -a -m -t $formatteddate $newfilename | |
done | |
IFS=$OIFS |
anyone have a working version for Sequoia?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original source: https://discussions.apple.com/thread/253230259