Notes App: (Picture) Attachments not showing

I’m creating a new note with jpg attachments. Although I see the ‘photo’ counter increment as expected, I can’t see any images when I view the note.

Checking the attachments of the note with AppleScript does reveal there to be the expected number.

Does anyone have any ideas please?

(Note: when the attachment is created, an attachment id is returned,
e.g. “x-coredata:///ICAttachment/t706A6082-1BC8-4BD6-AE73-B322CC3AA663185”
I wonder whether this could be exploited to rebuild the note with HTML?)

Here’s my script:

tell application "Notes"
	activate
	try
		set theNote to make new note in folder "SC" of account "On My Mac" with properties {name:"3038665"}
	end try
	tell theNote
		repeat with imageCounter from 1 to 8
			set theFile to "/Users/abc/Desktop/sc_download/0" & imageCounter as text & ".jpg"
			make new attachment at end of attachments with data theFile
			delay 1
		end repeat
	end tell
end tell

Hi.

It works for me if I use a ‘file’ or ‘alias’ specifier instead of just a POSIX path. Try changing the ‘set theFile …’ line to:

set theFile to ("/Users/abc/Desktop/sc_download/0" & imageCounter & ".jpg") as POSIX file

Thank you!

That does do it for me as well.