Jump to content

Note [Clear Reminder] with AppleScript


Recommended Posts

Hi!

In in a previous thread (below) I was working on automating some of my regular workflow with AppleScript.

This time around, I'm trying to remove the reminder from a note using AppleScript. I am able to mark it compete using this kind of move -

    set reminder done time of theNote to (current date)

However, what I want to do is remove the reminder altogether. The equivalent functionality in EN for OSX would be when you click on the reminder 'clock', and you get the option to [Clear Reminder].

I've done some reading on EN AppleScript properties (https://dev.evernote.com/doc/articles/applescript.php), but noticed that they've dropped remidners from this altogether. I think they were there, but perhaps not support is fading...? Either way, there's no information on how to remove a reminder here. I've also tried assigning 'missing value' to a few of the reminder order and reminder done time properties but no luck.

Any steers or suggestions welcome!

George

Link to comment
  • Level 5*
19 minutes ago, George ***** said:

This time around, I'm trying to remove the reminder from a note using AppleScript. I am able to mark it compete using this kind of move -

tell application "Evernote"

        set reminder order of theNote to missing value

        set reminder time of theNote to missing value

        set reminder done time of theNote to missing value

    end tell

 
Link to comment

Thanks for that, got me over the line. Here's what I ended up with -

tell application "Evernote"

activate

set theSelection to get selection

set theNote to item 1 of theSelection

set reminder order of theNote to missing value

set reminder time of theNote to missing value

set reminder done time of theNote to missing value

set reminder order of theNote to missing value

end tell

For some reason I had to set the reminder order twice to get it to fully change. But this script does the trick.

Any idea how I could mod this to do it for a list of notes selected in Evernote?

Cheers, George

 

Link to comment
  • Level 5*
12 minutes ago, George ***** said:

Any idea how I could mod this to do it for a list of notes selected in Evernote?

Currently, you have a list of notes theSelection
You said set theNote to item 1 of theSelection
Change this to a repeat loop

Here's my code

tell application "Evernote" to set theNotes to selection

 

repeat with theNote in theNotes

    ProcessNote(theNote)

end repeat

 
Link to comment

Thanks! Super helpful. I was able to implement using this.

Your code seemed to reference the note processing as a sub-routine, so I tried that as follows.

This code seems to work when I run it in FastScripts, but fails per the attached screen cap when I run it in the Script Editor.

Any idea why?

Thanks again, George

 

tell application "Evernote"



activate



set theNotes to selection

repeat with theNote in theNotes



set theNoteType to ProcessNote(theNote)



end repeat



end tell



on ProcessNote(thisNote)



set reminder order of theNote to missing value

set reminder time of theNote to missing value

set reminder done time of theNote to missing value

set reminder order of theNote to missing value



end ProcessNote

 

Screen Shot 2017-03-08 at 2.16.30 pm.png

Link to comment

Just noticed that I had 'theNote' rather than 'thisNote' in the sub-routine. Changed the whole sub to 'thisNote' and it no longer works. So I suspect I was getting lucky that the sub had 'theNote' (which matched the main body). Let me know if you have any advice on how to structure the sub. Otherwise, works fine with the set reminder commands inline. Thanks again, George

 

Link to comment
  • Level 5*
1 hour ago, George ***** said:

Just noticed that I had 'theNote' rather than 'thisNote' in the sub-routine. Changed the whole sub to 'thisNote' and it no longer works. So I suspect I was getting lucky that the sub had 'theNote' (which matched the main body). Let me know if you have any advice on how to structure the sub. Otherwise, works fine with the set reminder commands inline. Thanks again, George

 

Inline is just fine

fyi

In your ProcessNote subroutine you have a series of Evernote statements 

You need to surround those statements with    

tell application "Evernote"
....

end tell
Link to comment

Archived

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

×
×
  • Create New...