I’m having a bit of trouble automating the creation of notes in the Notes app from PDF using Automator when a PDF is placed in a designated folder. My AppleScript creates the note with an appropriate title OK, but the resulting note is always empty. I don’t seem to be able to get the content of the PDF into the body of the note. Some assistance would be appreciated. Here’s what I have so far, although I have tried several different things:
‘’’
on run {input, parameters}
tell application “Notes”
repeat with pdfFile in input
set pdfPath to pdfFile as alias
set fileName to name of (info for pdfFile)
set noteFolder to folder “!Unsorted” – Default folder
set noteBody to PDFFileBody
set newNote to make new note in noteFolder with properties {name:fileName, body:noteBody}
tell newNote to make new attachment with properties {file:pdfPath}
end repeat
end tell
end run
‘’’