rbianchi 66 Posted January 24, 2015 Share Posted January 24, 2015 It is possible to set the reminder date of a note with applescript? Edit: sorry, I put this topic in the wrong place. How to move to 'Help' section? Link to comment
Level 5 Adjusting 276 Posted January 27, 2015 Level 5 Share Posted January 27, 2015 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* JMichaelTX 4,118 Posted January 27, 2015 Level 5* Share Posted January 27, 2015 @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" 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 276 Posted January 27, 2015 Level 5 Share Posted January 27, 2015 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" http://en.wikipedia.org/wiki/Foobar Link to comment
Level 5* JMichaelTX 4,118 Posted January 27, 2015 Level 5* Share Posted January 27, 2015 Not to be confused with FUBAR. Which I did. Link to comment
rbianchi 66 Posted January 27, 2015 Author Share Posted January 27, 2015 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 tellHowever, 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 tellMaybe someone already has a similar script running?Any help will be very apreciated... Link to comment
Level 5 Adjusting 276 Posted January 27, 2015 Level 5 Share Posted January 27, 2015 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
rbianchi 66 Posted January 27, 2015 Author Share Posted January 27, 2015 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 Adjusting 276 Posted January 28, 2015 Level 5 Share Posted January 28, 2015 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. Link to comment
Level 5* JMichaelTX 4,118 Posted January 28, 2015 Level 5* Share Posted January 28, 2015 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
Idea
rbianchi 66
It is possible to set the reminder date of a note with applescript?
Edit: sorry, I put this topic in the wrong place. How to move to 'Help' section?
Link to comment
9 replies to this idea
Recommended Posts
Archived
This topic is now archived and is closed to further replies.