Printing Multiple Notes

As I’ve mentioned before we use Apple Notes a lot in our class. If the class are writing, unless there is a need for formatting or layout, I often ask the pupils just to stick to notes.

Notes are easily AirDropped to me when I need to collect work and both pupils and myself can organise them in a fairly simple manner.

Occasionally I want to print the pupils work. Notes, reasonably enough, only lets you to print one note at a time. I wondered if there was AppleScript that would help. I found Export Apple Notes via AppleScript which exported a folder of notes to a new TextEdit document. I altered it to:

Allow you to choose a folder from Notes.

Export to an html file on disk.

Provided page breaks so that the notes would each print on their own page.

Not particularly pretty, I guess I could work on the styles a little.

You need to be in my lucky position of having a mac in your classroom. Mine uses the same account as my iPad which helps me organise thing a lot.

Here is the code, I suspect it could be improved. Even if you don’t use AppleScript is easy enough to run. Open the AppleScript editor, create a new script, paste the code below in and hit run. You will be asked to choose a folder and then name an html file. The file will be created and opened with your default browser.
You then can print.

| set htmltop to "
|
|
|
|
| Notes Export
|
| @media print {
| hr {
| page-break-after: always;
| }
| }
|
|
| "
| set htmlbottom to "
| "
|
|
| tell application "Notes"
| activate
| set x to (name of every folder whose name is not "Notes")
| set foldertoexport to (choose from list x) as string
| if folder foldertoexport exists then
| set output to ""
| repeat with aNote in notes in folder foldertoexport
| set noteText to "<!– ### Start Note ### –>
| "
| set noteText to noteText & (" " & name of aNote as string) & "
| "
| — set noteText to noteText & (" Creation Date: " & creation date of aNote as string) & " "
| — set noteText to noteText & (" Modification Date: " & modification date of aNote as string) & " "
| set noteText to (noteText & body of aNote as string) & "
|
| "
|
| set output to output & noteText
|
| end repeat
|
| set thehtml to htmltop & output & htmlbottom
| set theNewFile to choose file name default name foldertoexport & "-notes.html"
|
| set myFile to open for access theNewFile with write permission
| write thehtml to myFile as «class utf8»
| close access myFile
|
| else
| display dialog "not likly to happen"
| end if
| end tell
|
| tell application "Finder" to open theNewFile
|

view raw

Notes-Export-to-HTML.scpt

hosted with ❤ by GitHub