Corey, what clock is used for the trigger? If it's UTC, then that might shift the snoozes at different times of the day throughout the globe (might be worth mentioning), but if it's "local" time for the user, then is the "midnight to 1am" selection guaranteed to only fire once when daylight saving time changes in autumn?
Olivier, you can set the time trigger for whatever time you want it to run. See http://code.google.com/googleapps/appsscript/guide_events.html#TimeTriggers for details on how to set up the trigger.
I'm able to create the script, but when I run the "setup" function I don't see any evidence that it's created the labels. I did authorize the script to modify my Gmail account.
@Hari-Once you have told the message how many days to snooze it runs in the cloud and you do not need to have a browser tab open nor even have your computer on. At setup you will create a once a day, time driven, trigger that resides on Googles computers(in the cloud) and will automatically update the snooze period on Googles computers.
@Olivier Dagenais Your local time zone is set up in the properties of the script editor when you create or upload the script. At setup you will also create a trigger from the script editor where you will specify what time of day or night you want the update snooze script to run.
Brilliant idea, but it doesn't work! Ran through the install 3 times now, following it word for word, but same as other peoples comments - no labels were created, and no evidence that anything has changed...
Definitely see Saurabh's comment above. Are you refreshing your Gmail window after running the setup() method?
Also, support can be handled much more easily via the forum. Please use that to get help with problems: http://www.google.com/support/forum/p/apps-script/
it now worked for me. It is necessary to close all (!) running instances of gmail. I presume that leaving one gmail-tab open let the setup script fail in my case.
Nice work. I too was stymied for a moment when the labels didn't seem to appear. But having closed Gmail and re-run the setup. Everything looks right.
In Outlook-land, I usually just build a calendar appointment and drag my e-mail item into it, in order to get it out of my inbox (I'm an inbox zero fan, as well). But, that's not as convenient to do with Gmail/Gcalendar. This is a good solution!
Pretty nice, altough it makes the menu a bit too long. Now that I've tried it, I would like to unisnstall it. How can I do ?(I've deleted the project, but apparently it wasn't enough)
A very nice feature, but now that I've tried it I would like to uninstall it. How do I do it?( I've tried to delete the project, but apparently it wasn't enough)
Instead of creating loads of labels, why not use the midnight event to add email IDs to the spreadsheet and then track the snooze progress in the spreadsheet each night. It would be a bit more complicated, but a lot neater and could be a nice example to build on.
My Labels never got created and this morning I get the following error emailed to me:
Your script, Gmail Snooze, 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 7/31/11 12:31 AM moveSnoozes TypeError: Cannot call method "getThreads" of null. (line 27) time-based 7/31/11 12:31 AM Sincerely,
Google Apps Script
Need help? Visit the Google Apps Script documentation. Please do not reply to this message. (c) 2010 Google
I have just written a spreadsheet based timer which allows you to set arbitrary dates in the future and customize the actions performed on expiration of the timer. I have applied to publish the code, but in the meantime you can view it here here.
Start Function Error Message Trigger End 7/30/11 12:10 AM moveSnoozes TypeError: Cannot call method "getThreads" of null. (line 28) time-based 7/30/11 12:10 AM
My own implementation of snooze email reminders for to-do tasks using google apps script: http://www.antoniorinaldi.it/build-your-own-pestering-email-reminder-using-google-docs/
NO LABELS SOLVED! Ok, so you have to actually save the Spreadsheet, and FIRST then Save the Script and run the Setup Trigger!
If you're like me, I had lots of triggers now so it Script Editior, go to Triggers -> All you triggers and delete all the old ones and recreate just the one.
All that remains are the "triggers" which seem to be just like a schedule which points to a non existent script.
Create the spreadsheet and save it. Open script editor, cut and paste and save the script. I saved the spreadsheet at this stage too - making sure that the new script is save in it.
Then rerun setup trigger and you're all set!
Very strafe way of doing this spreadsheet/script dependancy - Google Developers - can this be recoded please.
I agree with Peter Barganski: the current relationship between spreadsheets and scripts is very odd.
Could you not elevate scripts to the level of "product", i.e. on equal terms with gmail, calender, docs, etc. Or at least on equal terms with docs-spreadsheet, docs-writer, and docs-presentations, etc.
Obviously this is quite a big change, but scripts have great potential and deserve their own fully-featured home!
I guess the instruction "oldLabel.getThreads(0, 100);" should be "oldLabel.getThreads(n, 100);" where you add n at each loop. If not you are always looking to the first 100 items and it's never finishing.
Nope, the code is correct. The script moves all the threads in the "page" out of the oldLabel, so by the time you get to the next iteration of the loop, threads 0 to 100 are the next 100 threads. If you change it as you did, it will fail on threads 100-200 if you have that many snoozed.
You should buy boomerang and then it could be integrated tighter into gmail. And free. That would be awesome. Boomerang has a really nice, functional UI.
Is there a way to set a filter for incoming messages to trigger a snooze to jump to the inbox? This might be a separate thing, unless there's a way to add it directly. Like if I want to snooze a message only until a different anticipated message arrives, could that happen. Only show this in inbox when message from z arrives?
I would love to find out how to automate the install to install an a user's gmail. Ofcourse, with the user's permission, but all the user should have to do is click on a link I have emailed them to run the Snoozes install.
"TypeError: Cannot call method "getThreads" of null. (line 29)"
I found one thing to check for that might fix it. In your script window, go to View>Execution Summary
It will tell you what tasks the script completed before crashing.
In my case, I noticed that it was stopping after 5. When I debugged it was getting null with a value of 5. It turns out, I had actually deleted the label for the 5th day. So when the script asks Gmail to pull up the 5th day label, instead of finding zero threads, it was finding null threads and crashing the script.
I created this 5th day label, and this script now works. Oops.
TypeError: Cannot call method "getThreads" of null. (line 29)
In my case, it turns out I had accidentally deleted the day 5 label. That's why, instead of pulling up zero threads, Gmail was pulling up null threads. It couldn't find the label.
Could you please update this blog posting with how to remove the script for those of us who applied it? Something in the google Drive transition has deleted the script, yet still leaves us with daily messages like this one:
Date: Tue, 10 Jul 2012 17:30:18 -0700 (PDT) Message-ID: Subject: Summary of failures for Google Apps Script: Not found From: [email protected]
Your script, Not found, 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
7/10/12 8:11 AM moveSnoozes We're sorry, a server error occurred. Please wait a bit and try again. time-based 7/10/12 8:11 AM
Sincerely, Google Apps Script
Need help? Visit the Google Apps Script documentation. Please do not reply to this message. (c) 2012 Google
I took this script a little further and wrote a new one, which creates labels for the following 2 (or more) months, that you can snooze your mails. Take a look at it:
I had high hopes for this, to effectively replicate "flag for follow up" from Outlook.
Sadly the first part of the description talks about messages, but it's actually threads which are being 'moved', given the APIs for assigning labels can only be applied to threads, and not messages.
I logged in this morning to 32 unread emails, for two actual messages I'd marked to snooze a couple of days back. It had picked up all the emails in the thread and applied accordingly.
65 comments :
Wow, i like it.. a very brilliant usage of apps script
Does the app script run in the cloud or do you need to you have it open in a browser tab?
Corey, what clock is used for the trigger? If it's UTC, then that might shift the snoozes at different times of the day throughout the globe (might be worth mentioning), but if it's "local" time for the user, then is the "midnight to 1am" selection guaranteed to only fire once when daylight saving time changes in autumn?
Cheers,
- Oli
Sweet. Can you implement these other features while you're at it: http://messymatters.com/email
Can you guys please look into the spinning icon in my browser tab. It keeps spinning, Gmail never loads completely.
Olivier, you can set the time trigger for whatever time you want it to run. See http://code.google.com/googleapps/appsscript/guide_events.html#TimeTriggers for details on how to set up the trigger.
Drew
Nice. Thanks Chanoch. I never thought of using scripts to hack GMail.
Thanks Chanoch! I didn't realize that you can run App Scripts in GMail. And congratulations on being quoted in Lifehacker.
I'm able to create the script, but when I run the "setup" function I don't see any evidence that it's created the labels. I did authorize the script to modify my Gmail account.
Really cool thought behind the actual script. I love the function, it's actually a pretty necessary function.
the function is brilliant. i've always wanted an email tickler. THANKS!
@Hari-Once you have told the message how many days to snooze it runs in the cloud and you do not need to have a browser tab open nor even have your computer on.
At setup you will create a once a day, time driven, trigger that resides on Googles computers(in the cloud) and will automatically update the snooze period on Googles computers.
@Olivier Dagenais
Your local time zone is set up in the properties of the script editor when you create or upload the script. At setup you will also create a trigger from the script editor where you will specify what time of day or night you want the update snooze script to run.
I ran the script but dont see the labels in Gmail...any ideas?
I have followed the instructions, the script was enabled, but no labels were created in Gmail, even after reloading it completely.
If/when this will work, I can't wait to try to expand this, or make new great scripts :-)
After you run the setup() function, you can refresh your inbox and you will see the labels. All labels are create under a label called Snooze.
Please post on Apps Script forum if you still need support.
http://www.google.com/support/forum/p/apps-script/
labels don't show up in Gmail, even though no error occurs during creation.
Now the labels are there!
It took about 30 minutes to appear, maybe I was too excited to wait for them to appear, lol
Brilliant idea, but it doesn't work!
Ran through the install 3 times now, following it word for word, but same as other peoples comments - no labels were created, and no evidence that anything has changed...
I don't see the "setup" under the "Select a function to run" dropdown...am I doing something wrong?
A couple of other sites with instructions that might help those having problems.
http://questioningtechnologyzerzan.blogmonster.de/2011/07/29/how-to-add-a-snooze-button-to-gmail-no-extensions-required-video/
http://www.ditii.com/2011/07/27/creating-gmail-snooze-extension-with-google-apps-script-code/
NOTICE TO ALL -
Definitely see Saurabh's comment above. Are you refreshing your Gmail window after running the setup() method?
Also, support can be handled much more easily via the forum. Please use that to get help with problems:
http://www.google.com/support/forum/p/apps-script/
Cheers,
-Ryan
it now worked for me. It is necessary to close all (!) running instances of gmail. I presume that leaving one gmail-tab open let the setup script fail in my case.
awesome!! works for me
Like others, I followed the directions and the labels were not created. I'd love to find out when this works.
I'm running Chrome on Apple OSX 10.6
I'd recommend using Boomerang a Firefox/Chrome addon that does this and a lot more effortlessly --- 1 click install :)
www.boomeranggmail.com
I install last night but it not worked. How can I do now?
I installed last night but it not worked.
What can I do?
Nice work. I too was stymied for a moment when the labels didn't seem to appear. But having closed Gmail and re-run the setup. Everything looks right.
In Outlook-land, I usually just build a calendar appointment and drag my e-mail item into it, in order to get it out of my inbox (I'm an inbox zero fan, as well). But, that's not as convenient to do with Gmail/Gcalendar. This is a good solution!
How do we disable that stuff ?
I installed it. I guess it worked since i had the new label.
Though, since i installed it, i have problems with gmail widgets on my android phone.
So, I want to remove that script now. But i don't know how i can do that. Don't know where the script is now.
Could anybody help me please ?
Pretty nice, altough it makes the menu a bit too long. Now that I've tried it, I would like to unisnstall it. How can I do ?(I've deleted the project, but apparently it wasn't enough)
A very nice feature, but now that I've tried it I would like to uninstall it. How do I do it?( I've tried to delete the project, but apparently it wasn't enough)
Instead of creating loads of labels, why not use the midnight event to add email IDs to the spreadsheet and then track the snooze progress in the spreadsheet each night. It would be a bit more complicated, but a lot neater and could be a nice example to build on.
My Labels never got created and this morning I get the following error emailed to me:
Your script, Gmail Snooze, 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
7/31/11 12:31 AM moveSnoozes TypeError: Cannot call method "getThreads" of null. (line 27) time-based 7/31/11 12:31 AM
Sincerely,
Google Apps Script
Need help? Visit the Google Apps Script documentation. Please do not reply to this message. (c) 2010 Google
Regards,
Peter
my 2 query
1. can i use it for any gmail account
2.i cannot find the stup button
please remember I am using chrome browser and I have 1474 filters to use
I have just written a spreadsheet based timer which allows you to set arbitrary dates in the future and customize the actions performed on expiration of the timer. I have applied to publish the code, but in the meantime you can view it here here.
This is awesome! I've never used App Scripts before, but now I'm definitely planning a few more projects this summer with it. =D
Start Function Error Message Trigger End
7/30/11 12:10 AM moveSnoozes TypeError: Cannot call method "getThreads" of null. (line 28) time-based 7/30/11 12:10 AM
Not working for me either. No labels created after running setup() and
TypeError: Cannot call method "getThreads" of null. (line 27)
error in my inbox.
Please request support in our forum. Our community is very active.
http://www.google.com/support/forum/p/apps-script/
thank you
Saurabh
My own implementation of snooze email reminders for to-do tasks using google apps script:
http://www.antoniorinaldi.it/build-your-own-pestering-email-reminder-using-google-docs/
NO LABELS SOLVED!
Ok, so you have to actually save the Spreadsheet, and FIRST then Save the Script and run the Setup Trigger!
If you're like me, I had lots of triggers now so it Script Editior, go to Triggers -> All you triggers and delete all the old ones and recreate just the one.
It works! But now I cannot find my script, I did not save the spreadsheet, I saved only the code and the trigger. Where can I find the script.
The script is gonne - since t wasn't saved!
All that remains are the "triggers" which seem to be just like a schedule which points to a non existent script.
Create the spreadsheet and save it. Open script editor, cut and paste and save the script. I saved the spreadsheet at this stage too - making sure that the new script is save in it.
Then rerun setup trigger and you're all set!
Very strafe way of doing this spreadsheet/script dependancy - Google Developers - can this be recoded please.
I agree with Peter Barganski: the current relationship between spreadsheets and scripts is very odd.
Could you not elevate scripts to the level of "product", i.e. on equal terms with gmail, calender, docs, etc. Or at least on equal terms with docs-spreadsheet, docs-writer, and docs-presentations, etc.
Obviously this is quite a big change, but scripts have great potential and deserve their own fully-featured home!
Hello,
I guess the instruction "oldLabel.getThreads(0, 100);" should be "oldLabel.getThreads(n, 100);" where you add n at each loop.
If not you are always looking to the first 100 items and it's never finishing.
Best regards
Nope, the code is correct. The script moves all the threads in the "page" out of the oldLabel, so by the time you get to the next iteration of the loop, threads 0 to 100 are the next 100 threads. If you change it as you did, it will fail on threads 100-200 if you have that many snoozed.
Does this awp work for ANY gmail acc?
And where can I set up this file?
I try to install this last night but it didnt work so well.
What should I do know?
Thanks
mine is not working either....how do I delete and start over?
I cant get all the ones that say it dosent work and etc. Mine is working, fully.
Thanks anyway. Gmail rocks!
I must have done something wrong, because I can't find the label in Gmail, and I get an email every day that the script is not working.
How do I delete it?
You should buy boomerang and then it could be integrated tighter into gmail. And free. That would be awesome. Boomerang has a really nice, functional UI.
Is there a way to set a filter for incoming messages to trigger a snooze to jump to the inbox? This might be a separate thing, unless there's a way to add it directly. Like if I want to snooze a message only until a different anticipated message arrives, could that happen. Only show this in inbox when message from z arrives?
Works for me. Thanks :)
Works great for me :)
Well written and nice pictures. And the numbers are just growing every day... :)
@Rabatt - "Select All" + "Archive all" :)
I would love to find out how to automate the install to install an a user's gmail. Ofcourse, with the user's permission, but all the user should have to do is click on a link I have emailed them to run the Snoozes install.
Thanks Much JS
For everyone who had the following error:
"TypeError: Cannot call method "getThreads" of null. (line 29)"
I found one thing to check for that might fix it. In your script window, go to View>Execution Summary
It will tell you what tasks the script completed before crashing.
In my case, I noticed that it was stopping after 5. When I debugged it was getting null with a value of 5. It turns out, I had actually deleted the label for the 5th day. So when the script asks Gmail to pull up the 5th day label, instead of finding zero threads, it was finding null threads and crashing the script.
I created this 5th day label, and this script now works. Oops.
I was getting this error:
TypeError: Cannot call method "getThreads" of null. (line 29)
In my case, it turns out I had accidentally deleted the day 5 label. That's why, instead of pulling up zero threads, Gmail was pulling up null threads. It couldn't find the label.
Could you please update this blog posting with how to remove the script for those of us who applied it? Something in the google Drive transition has deleted the script, yet still leaves us with daily messages like this one:
Date: Tue, 10 Jul 2012 17:30:18 -0700 (PDT)
Message-ID:
Subject: Summary of failures for Google Apps Script: Not found
From: [email protected]
Your script, Not found, 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
7/10/12 8:11 AM moveSnoozes We're sorry, a server error occurred. Please
wait a bit and try again. time-based 7/10/12 8:11 AM
Sincerely,
Google Apps Script
Need help? Visit the Google Apps Script documentation. Please do not reply
to this message. (c) 2012 Google
Great idea, Google Scripts is going to be very useful.
I had another idea.
Use filters together with Gmail's "disposable" address feature to enable you to email yourself in the future.
E.g. [email protected]
I took this script a little further and wrote a new one, which creates labels for the following 2 (or more) months, that you can snooze your mails. Take a look at it:
Gmail Snooze
I had high hopes for this, to effectively replicate "flag for follow up" from Outlook.
Sadly the first part of the description talks about messages, but it's actually threads which are being 'moved', given the APIs for assigning labels can only be applied to threads, and not messages.
I logged in this morning to 32 unread emails, for two actual messages I'd marked to snooze a couple of days back. It had picked up all the emails in the thread and applied accordingly.
So sadly this doesn't work for me.
Post a Comment