Wednesday, June 26, 2019

#1 2019-01-10 05:52:16 pm

bernardharte
Member
Registered: 2005-11-12
Posts: 3

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:

Applescript:

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

Offline

 

#2 2019-01-11 01:34:33 am

Nigel Garvey
Moderator
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 4884

Re: Notes App: (Picture) Attachments not showing

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:

Applescript:

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


NG

Offline

 

#3 2019-01-11 10:56:14 am

bernardharte
Member
Registered: 2005-11-12
Posts: 3

Re: Notes App: (Picture) Attachments not showing

Thank you!

That does do it for me as well.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)