Jump to content
  • 0

Note reminder & Applescript


rbianchi

Idea

9 replies to this idea

Recommended Posts

  • Level 5

here’s an example:

tell application id "com.evernote.Evernote"	set note_query to "notebook:Four"	set foo to find notes note_query	set bar to first item of foo	set reminder time of bar to date "Friday, April 15, 2016 at 4:29:04 PM"end tell
Link to comment
  • Level 5*

@Adjusting:  Thanks for the sample code.

 

I have to say that your choice of variable names is, well, interesting.   ;)

 

You use "foo" and "bar", which reminds me of "fubar".

I assume you know the meaning of "fubar"  :D

 

 

here’s an example:

tell application id "com.evernote.Evernote"	set note_query to "notebook:Four"	set foo to find notes note_query	set bar to first item of foo	set reminder time of bar to date "Friday, April 15, 2016 at 4:29:04 PM"end tell

 

Link to comment

Thanks Justin,

 

I am not an expert in aplescript, so this is taking me more time than desired.

 

What I want to do is set up a rule in Haze (http://www.noodlesoft.com/) to save my bills to evernote.

 

The following code works fine ( 'theFile' is the PDF file that I save to evernote)

It save the file in the notebook 'InBox' with the tags 'internet' and 'bills' (great!)

tell application "Evernote"	activate	create note from file theFile notebook {"InBox"} tags {"internet", "bills"}end tell

However, I have failed in all attempts to add a reminder date to the created note.

The following code do not work...

tell application "Evernote"	activate	create note from file theFile notebook {"InBox"} tags {"internet", "bills"}        set dd to (current date)	set myNote to selection	set reminder time of myNote to date ddend tell

Maybe someone already has a similar script running?

Any help will be very apreciated...

Link to comment
  • Level 5

https://discussion.evernote.com/topic/60390-applescript-to-set-modification-date-to-created-date/?p=281289

 

selection (list of note, r/o) : The note(s) selected in the front-most window. Returns empty list if the front-most window is not a collection or note window, or if there is no front-most window.
Since selection returns a list, if you want to modify a note, you have to specify which item of the list you want. Try something like this:
tell application "Evernote"	set x to selection	set y to item 1 of x	set (modification date of y) to (creation date of y)end tell

 

In your case you’ll want to set the reminder time rather than the modification date, but the concept is the same; You’ll need to pick one item of the selection, or loop through each item.

Link to comment

Wow!, thanks for the quick reply.

You are correct. I learned a little more applescript, but unfortunately, the script does not work has I expect.

 

I suspect that it is a problem with the date format.

In spanish "Friday, April 15, 2016 at 4:29:04 PM" is "viernes 15 de abril de 2016 16:29:04" and it seems that evernote does not like that format.

 

following is the error message in the console:

 

    NSLocalizedDescription = "Evernote got an error: Can\U2019t set date (date \"mi\U00e9rcoles 28 de enero de 2015 19:43:13\") to date (date \"mi\U00e9rcoles 28 de enero de 2015 19:43:13\").";
 

Link to comment
  • Level 5*

You’re right. Your script won’t run in any language except English. I’ve raised the issue with our developers to figure out whether this is an issue with Evernote or with Applescript.

 

Seems like the best solution would be to set the Reminder Date/Time using a standard AppleScript Date object, which may require a change in the Evernote / Applescript interface.

 

This should work in all languages.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...