Notes dictionary. Body property

Hi everybody.

I´m reading the “Notes” dictionary and I don´t understand why I don´t see the “body” property in the note class.
The documentation shows as properties “container”, “creation date”, “id”, “modification name” and “name”, and “attachment” as element.
The explorer pane shows it.
I need help

Thanks

Hey Alberto,

That’s pretty clearly a bug.

-Chris

Same in Script Editor. No “Body” property of the Note class.

But, now that you know, thanks to SD’s explorer, that is has a body property, what help do you still need?

FWIW, the body property seems to return XML text

tell application "Notes"
 body of every note
end tell

 <div>Paragraph</div>

That was what I thought.
It was very strange for me to see the same bug in two apps!!
Thanks all for your time

Looking in the scripting definition file for Notes, it shows this:

<contents name="body" code="body" type="text" description="the HTML content of the note">
 <cocoa key="scriptingBody"/>
</contents>

It should be this:

<property name="body" code="body" type="text" description="the HTML content of the note">
 <cocoa key="scriptingBody"/>
</property>
1 Like

Hello Shane

I guess that if we edit the script definitions file by hand the application will no longer work.

Yvan KOENIG running El Capitan 10.11.6 in French (VALLAURIS, France) lundi 12 septembre 2016 17:54:01

I believe that any change to the contents of the application will invalidate its code signing.

We have found that the <contents> element is valid. Script Debugger recognizes it when creating its list of properties in the explorer, but fails to render it in the dictionary description (which is generated via a different code path: XML->XSL->HTML).

For the time being, just know that there is a body property. I’m working on amending Script Debugger’s dictionary display for 6.0.2 to display this information properly.

1 Like

Hello Mark
It seems that my English wording was not clear.
I was not writing about Script Debugger but about the sdef file of Notes in which there is something wrong.
I applied brute force.
I booted from Sierra
Opened the sdef of the 10.11.6 Notes
Edited the two typos
Saved the edited file
reboot under 10.11.6

Bingo, Notes continue to work and body is correctly described when I open the Notes’s dictionary in the Script Editor.

More, the oddity doesn’t strike in Sierra’s Notes application.

Yvan KOENIG running El Capitan 10.11.6 in French (VALLAURIS, France) lundi 12 septembre 2016 22:01:18

No, there is nothing wrong with it – the rules have changed, and at this stage neither Script Editor nor Script Debugger have caught up.

Here’s how I propose displaying <contents> elements in the dictionary display:

Any thoughts?

1 Like

Looks good to me. But then you’ve explained to me what’s happening :wink:

I wonder whether just showing it as a property is enough…