Created
December 13, 2019 18:02
-
-
Save DustinAlandzes/2fe249252c017b15d333bc01a44d2cb8 to your computer and use it in GitHub Desktop.
Used this script and https://writeapp.net/notesexporter/ to export text from notes.app
This file contains 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
import os | |
from markdownify import markdownify as md | |
import sys | |
print(sys.getdefaultencoding()) | |
NOTES_PATH = "/Users/f00/Documents/notes-backup" | |
notes = os.listdir(NOTES_PATH) | |
for note in notes: | |
with open(f"{NOTES_PATH}/{note}", 'r+', encoding="ISO-8859-1") as f: | |
note_data = f.read() | |
f.write(md(note_data)) | |
for note in notes: | |
os.rename(f"{NOTES_PATH}/{note}", f"{NOTES_PATH}/{note[len('Notes'):].replace('.txt', '.md')}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment