iNik

EN 5.0.5 AppleScript syntax for checkboxes

11 posts in this topic

The release notes for EN 5.0.5 say that AppleScript can now create checkboxes in ENML. I do not see any additions in the documentation explaining the syntax, nor can I create checkboxes. What is the appropriate syntax to create a checkbox?

Thanks!

Share this post


Link to post

You can create checkboxes by adding EN-TODO tags when importing a file for a note using the following syntax:


create note title "Note 4" from file "/path/to/a/file.txt" notebook notebook1

Share this post


Link to post

I'm sorry, Julien, but I don't understand your answer. Are you saying the only way to create checkboxes is by creating a new note from a text file that already contains the markup for them?

This seems of very limited usefulness to me. Can you perhaps elaborate?

Share this post


Link to post

Agreed. This really needs to work for note creation, appending and editing in text and html mode.

Share this post


Link to post

Julien, the syntax you gave doesn't seem to work with a text file. The only syntax that did work for me was:

create note with enml "<en-todo/> Foo"

Since ENML is about the same as HTML, this works all right for creating notes. (Provided I remember to put some paragraph tags in for new lines -- it would be nice to have a "create line breaks" option on import/append of HTML and ENML.)

Still, without editable ENML content and the ability to append, this is a very limited solution. I'm still pretty much stuck with the work-around of exporting the note to a temporary ENML file, editing the ENML as text, deleting the original note, and finally importing the edited ENML file. Inelegant to say the least.

My dream would be to access checkboxes as objects of the note, as with attachments. Something like:

get todos of note x 

and

check todo 1 of note x

and

append todo to note x with text "here is a new todo item" 

One necessity here would be to have a "text" property of Todos that contains any text/markup on the same line as the todo -- otherwise they'd be pretty useless as objects.

Share this post


Link to post

Did you try using the "append" command?

append note : The note to modify.

[text text] : Text to append.

[html text] : HTML to append.

[attachment file] : Attachment file to append.

Share this post


Link to post

It only seems to work with ENML, which cannot be appended.

Share this post


Link to post

You can append HTML/text to the existing ENML. However, it is not possible to append checkboxes at this time. We will add this feature soon.

Share this post


Link to post

Hi,

 

You can use this API to append :

 

 

append note : The note to modify.


[text text] : Text to append.


[html text] : HTML to append.


[attachment file] : Attachment file to append.

 

Thanks,

Mustafa

Share this post


Link to post