Jump to content
hoo22

AppleScript to add Reminder

Recommended Posts

The most frustrating feature omission of the Mac app is having no keyboard shortcut option to add a reminder to a note.
(The manual cursor-based option is just so slow).
 
Is there an AppleScript available that I can trigger with a keyboard shortcut to add a reminder?
 
I’m not particularly technically minded, so can’t build a script myself.
 
Ideally, I’d like a script to add a reminder with with no date, and another script to add a reminder with a date.
 
 

Share this post


Link to post
29 minutes ago, hoo22 said:

s there an AppleScript available that I can trigger with a keyboard shortcut to add a reminder?

Here's my reminder script
My keyboard shortcut is Command Option R

tell application "Evernote"
     set reminder time of theNote to date ((text returned of (display dialog "Reminder Date" default answer (yyyymmdd & " 8:00 am"))))
end tell1842677240_ScreenShot2020-05-01at7_57_09AM.png.0087c40ca4f34e42533099d0c9143bf4.png

 

  • Like 1

Share this post


Link to post

Thanks DTLOw, that's great.

Do you know if there's a script that doesn't require a date input, and just creates a reminder; as I'm mostly looking to create reminders without dates.

 

Share this post


Link to post
8 minutes ago, hoo22 said:

Do you know if there's a script that doesn't require a date input, and just creates a reminder; as I'm mostly looking to create reminders without dates.

set reminder order of theNote to current date

Share this post


Link to post

I've tried your first option in Script Editor with no luck.

And have no idea how to turn that into a keyboard shortcut. (See screen shot).

As I said, I have no scripting knowledge, so I may be missing something obvious.

As for the no-date reminder...I'm also lost.

Screenshot 2020-05-01 at 16.23.31.png

Share this post


Link to post
18 minutes ago, hoo22 said:

I've tried your first option in Script Editor with no luck.

There were two variables in the script
yyyymmdd
theNote

These have to be defined

I use this code for the date yyyymmdd
     set {year:yyyy, month:mmm, day:d, weekday:dddd} to ((current date))
     set dd to (text -2 thru -1 of ("0" & d as text))
     set m to mmm as integer
     set mm to (text -2 thru -1 of ("0" & m as text))
     set yyyymmdd to yyyy & "/" & mm & "/" & dd as string

For theNote
     tell application "Evernote" to set theNotes to get selection
     set theNote to item 1 of theNotes

Share this post


Link to post
39 minutes ago, DTLow said:

tell application "Evernote"
     set reminder time of theNote to date ((text returned of (display dialog "Reminder Date" default answer (yyyymmdd & " 8:00 am"))))
end tell

@DTLow, I like the idea of your script, but it won't run as is.  I think you forgot to include parts of your script that define 'theNote" and "yyyymmdd".

Share this post


Link to post
21 minutes ago, hoo22 said:

And have no idea how to turn that into a keyboard shortcut. (See screen shot).

There is a method using Mac Services
I use third party Fastcript to add keyboard shortcuts to my scripts

Share this post


Link to post

You guys might be interested in this simple code to get the date as an ISO formatted string:

set dateISOStr to text 1 thru 10 of ((current date) as «class isot» as string)

 

Share this post


Link to post

Ok, so far I’m lost.

 

I guess I was just wondering if there’s a script that I can simply download which I can get to run when I use a keyboard shortcut, without me tinkering with the script and other third party apps?

 

I can’t over-emphasise enough that I have no experience with scripting, but have downloaded applescripts that run out of the box.

 

Share this post


Link to post
5 minutes ago, hoo22 said:

Ok, so far I’m lost.
I guess I was just wondering if there’s a script that I can simply download which I can get to run when I use a keyboard shortcut, without me tinkering with the script and other third party apps?
I can’t over-emphasise enough that I have no experience with scripting, but have downloaded applescripts that run out of the box.

I can advise you on writing scripts, and provide assistance when you get stuck
I'm not comfortable providing "run out of the box" scripts

Share this post


Link to post
39 minutes ago, JMichaelTX said:

You guys might be interested in this simple code to get the date as an ISO formatted string:


set dateISOStr to text 1 thru 10 of ((current date) as «class isot» as string)

 

Thanks, I've made note of that   
I prefer using my own code; It allows me to deviate from ISO format (I'm a rebel)

Share this post


Link to post
8 minutes ago, DTLow said:

I can advise you on writing scripts, and provide assistance when you get stuck
I'm not comfortable providing complete scripts

That’s fine, thanks for your help so far, but I’m not looking to spend time learning to write AppleScript through a trial and error learning process. One day when things are less busy maybe. ☺️

If anyone else is able to share a click and run AppleScript for me, then I’d love to hear from you.

Share this post


Link to post
15 minutes ago, hoo22 said:

If anyone else is able to share a click and run AppleScript for me, then I’d love to hear from you.

Here's my version:

set today to current date
set numDays to 1 -- set to number of days in future
set futureDateStr to short date string of (today + (numDays * days))


tell application "Evernote"
	set {oNote} to selection
	
	set reminder time of oNote to date ((text returned of (display dialog ("Evernote Note:" & return & title of oNote) default answer (futureDateStr & " 8:00 am") with title "Set Reminder Date")))
end tell

2020-05-01_11-13-34.png.3f52a11194d23dc47ecd53d524f36a53.png

something is causing this image to appear twice.

2020-05-01_11-13-34.png

Share this post


Link to post

That's brilliant. Thanks JMichaelTX

Really appreciated.

I'll keep looking for non-date reminder options, but for now that date reminder script works nicely, and I've now created a shortcut for it.

😀

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...