Apple script: Backup Mac Notes to PDFs

1. Open Notes and click folder you want to backup
2. Open script and copy content to Mac ScriptEditor and run, or choose scpt to run in ScriptEditor
3. Gen pdfs
4. OS: Catalina 10.15.X
Can further modify based on it

set cnt to 58
set i to 0
tell application "System Events"
	repeat cnt times
		tell process "Notes"
			set frontmost to true
			click menu item "Export as PDF…" of menu 1 of menu bar item "File" of menu bar 1
			delay 2
			key code 76
			key code 1 using {command down}
			delay 1
			key code 15 using {command down}
			delay 5
			key code 125
		end tell
	end repeat
end tell

Leave a Reply

Your email address will not be published. Required fields are marked *