Thursday, September 3, 2015

Why cant you get calendar alerts from google Tasks? Now you can!

How to get calendar alerts from google tasks.

Here is a short scrip that will transfer all tasks with due dates onto an alerts calendar.
To set up

  1. Go to your calendar
    1. Create a new calendar called "Reminders"
    2. Edit Notifications for that calendar to get emails sms or popups.
  2. Go to "script.google.com"
    1. Create a new blank project
    2. Paste this code in there (overwrite anything that was in there).
    3. Save the code
    4. "Resources"-> "Current Project's Triggers" -> "click to add new trigger"
      OR
      click the trigger icon (clock inside a speech bubble next to the save and play icons )
      NOTE: If this is the first time you are doing this you need to enable 2 things before step 4
      1. Resources -> "Advanced Google Services" - Enable the TASKS api
      2. console.developers.google.com/apis - search for "tasks" and enable it.
         
    5. Select "Time Driven" and as frequent as you want it to run (5 minutes is good)
    6. Save
To Use
  1. Go to Gmail, and select "Tasks" from the drop down (other options are mail and contacts)
  2. Any task that is not completed which has a due date will be transferred to the "Reminders" calendar and marked completed.
  3. A task can be created from an email (shift-T)
  4. Tasks that do not have a due date will not receive this treatment.

N.B

you need to enable advanced services



(this has been asked for a lot - e.g. )

7 comments:

  1. HI, tried this, but it didnt work. In the advanced setting, would it suffice to enable only calendar and tasks api or would it need more?

    ReplyDelete
  2. in the advanced (https://developers.google.com/apps-script/guides/services/advanced)
    you only need to enable the Tasks (Calendar is not necessary)

    note that it needs to be enabled in two places

    Resources > Advanced Google services....
    and
    The "Developer's console"

    that second one is a bit tricky(not as described)

    from the script editor click "Developer's console project"

    a dialog will open and it will have a link to the project the script is associated to
    click it

    then on the right navigation bar click APIs
    then
    search for "tasks"

    you'll see it, enable it

    i just tried this now, i don't remember if it was different when I wrote this

    ReplyDelete
  3. Thanks, i just figured this yesterday. The developers console is indeed a bit tricky with so many options.

    Thanks a ton for your efforts!!

    ReplyDelete
  4. Co-incidentally, the documentation has now been fixed on the developer's page. :-)

    ReplyDelete
  5. I recieved the following error message when using this script. Any suggestions on how to fix this (sorry such a basic question, I'm not a programmer). Thanks!

    Your script, Tasks reminder, has recently failed to finish successfully. A summary of the failure(s) is shown below. To configure the triggers for this script, or change your setting for receiving future failure notifications, click here.

    Details:

    Start Function Error Message Trigger End
    1/7/16 5:59 PM copyTasksToCal ReferenceError: "Tasks" is not defined. (line 2, file "Code") time-based 1/7/16 5:59 PM
    Sincerely,

    Google Apps Script

    ReplyDelete
  6. I find that occasionally i get these messages, but then normal operation resumes.
    Are you still getting them?
    Does the script work?

    ReplyDelete
  7. Thanks for your reply. Actually the script works well but I stopped using it for a couple of other reasons. 1. The script would "cross off" the task in my task list, and I'd rather not have that. and 2. The task was created in my calendar more than once.

    So I have decided to just keep a "tasks" tab open in my browser so I can check in often.

    Thanks.

    Dan

    ReplyDelete