Automatically label lingering emails with this Google Apps Script

I try to keep my inbox clean, and for the most part I do a pretty good job at it. There’s one bad habit I have, though. I star emails in Gmail so I’ll remember to follow up with them later, and then I never get around to it. Emails just keep getting pushed further down the list and piling up. I can’t deal with all emails right away, but after a while they just stick around because I’m avoiding making a decision on them. What I need is a way to automatically to something give myself a little nudge after a certain amount of time. A little push that will remind me that those emails aren’t going to just answer themselves.

After looking at a lot of solutions (Gmail filters, IFTTT.com, etc), I finally discovered Google Apps Scripts. You can write javascript functions to do all kinds of automations in your inbox. You can then set the functions to run on a timer. It was exactly what I was looking for.

I was able to write a couple of functions to automatically add a label to any items that were in my inbox that also had a star label. When I remove the star, or archive the email, the label is removed. Here’s what the output looks like.

deal with me label-1

Here’s how I set it up

Go to script.google.com, and create a new project. I called mine “Add nagging label for old starred items”

Paste in the following code

[updated 4/23/13 to fix a bug that was causing un-starred threads to not have the label automatically removed]

Save the script, then test to make sure the scripts are working by selecting the “addNaggingLabels” or “removeNaggingLabels” functions from the dropdown in the script editor toolbar, then clicking the arrow to run them. You’ll be asked to allow the script to be run on your inbox before you can test it out. You should only have to do that step once.

When the “Deal with me” label gets created, it won’t be red by default. You’ll have to go find it in the left sidebar of your Gmail inbox and click the arrow next to it to manually change the color to red (or some color you really hate. Whatever will be the most motivating).

Finally, click the “triggers” icon, and set up the following triggers so both functions run every hour.

Deal with me gmail label

That’s really all there is to it. Now, I get a nice big red label automatically added to any stale starred items. It doesn’t totally prevent things from piling up, but it helps give me that little prod to make an effort to keep things tidy.


Cultivate a hacker mentality to improve your workplace productivity

“Progress isn’t made by early risers. It’s made by lazy men trying to find easier ways to do something.” – Robert Heinlein, American science fiction writer

In the course of doing our day to day work, we have to spend lots of time doing repetitive tasks. Over time, the inefficiencies can become really obvious (not to mention annoying). Usually, we put up with it. But there are a bunch of good reasons not to. Many processes evolve organically, and you shouldn’t assume that there’s a rational reason for why you’re doing something the way you are. Sometimes a small change will make a big difference, and you, as the person having to put up with the painful tedium, are the perfect person to think of it.

One of the best pieces of professional advice I ever got was:

“Get good at looking for ways to get 80% of the work done in 10% of the time. Not to drive company efficiency, but to preserve your own sanity.”

That may sound like cultivating laziness, but it’s actually the opposite. There’s always going to be more to do, and that mindset that encourages you to be protective about your time, which is a really strong motivator to minimize the things that feel like a bad way to spend it.

So, learn to look for the simple and clever hacks in your day to day routines. Here are a few links to help inspire you.

Employee driven innovation

This slideshow from Prachi Gupta at LinkedIn does a great job of illustrating why a hacker mentality is important, and showing how LinkedIn nurtures the habit on a company-wide level. They have monthly “Hackdays” where everyone in the company gets to work on anything they want. They even take the best hacks and give people months to work on making them a more solid, scaleable solution.

Among many gems in the presentation is this definition of what exactly is meant by the term “hack” in this context:

“A ‘hack’ is a quick and dirty solution to a real world problem. It’s never perfect or complete, but it’s almost always clever and insightful.”

A “Kaizen” Improvement at a Wine Bar – Is it “Lazy” or Smart?

This post focuses on the Japanese concept of Kaizen, or “change for the better”, and explores the sometimes blurry line between “lazy” and “efficient”. He makes the good point that laziness can get a bad reputation, and should be looked at as a more positive attribute. He also provides some great examples about how the person doing the day-to-day repetitive tasks is often the best person for innovating on the process.

A culture of lies and laziness

Don’t get too carried away with the shortcuts, though! It’s great to find novel and clever solutions to problems that save you time, but be careful you’re not doing it at someone else’s expense. This explores where the line is and what happens when you cross it. In short, hack, but have a conscience about it.

99 Life Hacks to make your life easier!

Finally, here are a bunch of ridiculous, and ridiculously clever life-hacks for making everyday tasks a little bit easier. How can you apply that type of thinking to the things you do every day?


Weekly Productivity Links: How what we hear affects our work

headphones

Last week, we were having a discussion about how to break out of a rut, and several people mentioned that having the right music helped them get focused and productive. So I did some research, and it turns out noises of all kinds can have a big effect on your productivity. Auditory information can enhance your state of focus, or it can completely derail it. Here are a few links exploring the connection between what’s going in your ears and getting things done.

Cellphones Conversations as a Modern Irritant

Hearing only one side of the conversation is way more distracting than the whole thing, according to a recent study. Your brain has to work harder because of a natural tendency to want to fill in the blanks of the conversation. Something you may want to keep in mind if you work in an office with other people who often make phone calls.

Coffee Shop sounds can boost your productivity

Not all background noise is distracting however. Sometimes, the bustle and commotion of a public space can be better for focusing than a quiet office, especially for creative activities. I personally use coffee shops as my email-office, but apparently you can get the same benefit by simply hearing the sounds of a busy cafe. Coffitivity let’s you experience the ambiance of a coffee shop from anywhere. You can even adjust the volume of the loop so you can play your own music on top of it, just like you would if you were there.

I’ve been trying coffitivity out while writing this post, and even though it feels a little bit silly, there’s something really comforting about the coffee shop soundtrack.

Workers, Put Those Headphones On

Sometimes, it’s not the music that helps boost your productivity, it’s the medium you use to listen to them. Wearing headphones, even without listening to music, can help you block out distractions. Even better, they can send a signal to those around you that you’re in the zone and aren’t to be disturbed.

The Power of Music, Tapped in a Cubicle

Of course, you probably aren’t going to wear headphones solely as a fancy do-not-disturb sign. And you shouldn’t, as there are many benefits of listening to music. Melodious sounds cause a release of dopamine, giving our brains the same satisfying reward as eating a fancy treat or smelling a pleasant aroma. Research shows that listening to music while working will help you complete tasks faster, and come up with more creative solutions.

Choose Unfamiliar Work Music for Better Productivity and Focus

I’m a creature of habit. I listen to the same playlists over and over (mostly 90′s punk rock with some instrumental metal thrown in occasionally, if you’re curious). Apparently that might not be the most productive strategy. Unfamiliar genres may ultimately be better for maximizing focus, according to the folks at Focus@Will. They are a service that offers streaming of productivity-optimized music, with what appears to be a pretty impressive amount of science backing them up. I’m not sure how much I agree with them, though. I think the concept sounds really interesting, but I kept finding myself distracted by the fact that I’d rather be listening to something I’m more familiar with. Old habits die hard, I guess. I do enjoy unfamiliar music within a familiar genre, however. Music discovery services like Last.fm, Pandora, and Spotify are great for that.

Follow RescueTime on Twitter or Facebook for more updates and links about staying productive in the modern workplace.


What’s your productivity hack for powering through the last 10% of a project?

Getting across the finish line

Everyone’s had that moment

You’ve been working on a project that’s humming along really well, and you’re nearing the point where you can see the end of it… then boom!  All of a sudden everything grinds to a halt, and you run smack into a brick wall that keeps you from bringing it across the finish line. Try as you might, you can’t seem get things rolling again. Distractions become more distracting, and the excuses and justifications start to form an unsatisfying pile where you’re finished project should be.

It’s a crappy feeling. I know because I’m in the middle of one right now. It’s frustrating and doesn’t make any sense, because I’m working on building something that I’m really excited about.

I’d like to pose a question to you

You seem like smart folks, and I know I’m not alone with this problem. How do you break down that wall that’s blocking you from finishing up the last little bit of a project? What are your best productivity hacks or strategies for breaking out of a rut?

Please share in the comments!


Breaking down the RescueTime productivity score

productivity-scoreThe RescueTime productivity score is a way of looking at your time based on the productivity level you’ve assigned to the various activities that you’ve logged time for. It’s a way to boil your time down to a single metric, so you can get a quick understanding of how you’re spending it without having to dig into the more detailed reports.

But, it sometimes generates a bit of confusion, so I wanted to dig into it a bit and see if I could clear up some of the misconceptions.

How exactly is the productivity score calculated?

First off, it helps to know exactly what that number means. RescueTime lets you assign any activity or category a productivity level. There are five options, ranging from “very distracting” to “very productive”.

If you assign a productivity level to a category, it will filter down to all activities in that category, unless you explicitly add a productivity level to an activity, in which case it will override the category productivity level.

Your overall productivity score is calculated as an average of the time spent on each productivity level. If you spent all day on activities marked as “neutral productivity”, you’d have a 50% productivity score. If you spent all day on something marked as “Productive”, you’d have a 75% productivity score. All day in activities marked “very productive”, you’d have a score of 100%.

Misconception: “My productivity score should be as high as possible, right?”

Some facts:

  • The average productivity score across the entire RescueTime user base is 67%. While obviously I haven’t talked to all of them, I can tell you these aren’t a bunch of slackers. They’re smart people who are very thoughtful about how they spend their time.
  • Around the RescueTime office, we’re averaging around 79%. We think about this stuff a lot, and I think we’re pretty well optimized for productivity.

Occasionally I see comments from users that suggest that they think they should be shooting for a productivity score of 100%. I can understand the sentiment, if you’re really efficient and getting all my work accomplished, it seems like the number should reflect that, right? Honestly, if we were rebuilding RescueTime from scratch, we might choose a less charged label than “productivity”. But the bottom line is that the productivity score doesn’t tell you anything about what you actually produce. It’s simply a number that can give you an interesting baseline of where your attention is, but doesn’t tell 100% of the story. It’s a way to understand your patterns, and not a prescription for how you should be spending your time. Moreover, there are some pretty compelling reasons why you shouldn’t shoot for a super-high productivity score.

Let’s look at another metric for context, shall we?

If you were tracking your Body Mass Index, you might want it to be lower, but you’d never want it to be zero! Through a lot of research, there are some accepted guidelines, but the scale itself doesn’t make an implication about an absolute measure everyone should shoot for. What it does, however, is give you a number that becomes important context for your physical activity. If you’re exercising more, you’ll likely see your BMI drop. If you’re eating a lot more, you might see it rise.

So, what’s the “healthy” range of productivity?

Since how you spend your time on the computer hasn’t received the same amount of scientific scrutiny as BMI, there isn’t such a clear recommendation. It’s really contextual. What may be the ideal mix of activities for you might not be for someone else. It’s also important to remember that just because something that’s classified as “distracting” doesn’t mean it’s not valuable. But it’s a good generic measure of where your attention is focused.

Some tips for using your productivity score

Change it to suit your needs: It’s important to remember that we try to make RescueTime as customizable as possible, so you can change the productivity levels to match what YOU consider to be productive or distracting.

Don’t think of it as a judgement. So many factors enter into your time that it’s impossible for a system to say definitively how you should be spending your time. The best we can do is give you a measure that you can use to make your own judgement. Work-life balance is different for everyone.

It will fluctuate, and that’s ok. The changes mean just that, something has changed. Not necessarily good or bad. See how it changes over time and you’ll have a better understanding of your natural patterns.

Downtime is good and healthy. No one should be expected to be 100% productive all the time. In fact, there’s a big pile of science that says it’s bad for the quality of your work, your creativity, and your well-being.

The score is a helpful metric when you’re trying new things. If you’re trying to optimize the way you work, the changes to your productivity score baseline can give you an objective measure of the impact of your changes. For example. I tried an experiment and turned off all notifications on my phone and computer. Just that change alone caused a 9% rise in my productivity score.

Hopefully that helps paint a clear picture of the productivity score and how we think it can be valuable. If you have any questions or thoughts, let us know in the comments!


Productivity Hack: try “location boxing” your activities to train your brain to switch gears

locationbox

For the past week, I’ve been taking an hour or so at the coffee shop near my office to knock out most of my email and communications. Then when I get back to the office, I stay out of email as much as possible. The experiment has made me realize that shaking up my work environment can help me stay more focused and productive. It’s sort of like the concept of Timeboxing but with more of a physical twist. “Location boxing” seems appropriate.

Getting your head in the right place for a new activity is hard

There are four main types of thinking I need to do in a typical work week:

Design-thinking: Visual design and thinking about the user experience

Coding-thinking: Building new features, solving technical problems

Business-thinking: Internal communications, interviews, and helping out on some sales calls

Support-thinking: Bug fixes, and responding to questions from RescueTime users

It’s next to impossible to do any of those simultaneously and be effective. You have to get into the correct mindset for each one. Design and coding require substantial periods of “maker time“, while support, sales, and communications generally involve a lot of rapid-fire bouncing around from task to task.

Timeboxing is a great idea, but I’ve found it really hard to stick to. Maybe I’m a little too scatterbrained, but my meticulously planned out schedule can easily be derailed by things like email, which can swoop in unexpectedly and steal hours from my day. Plus it’s just hard for me to flip the mental switch between, say, customer support mode and design mode.

The answer? Restrict activities to a location

Taking advantage of my proximity to the ocean and working on a boat

Altering my physical environment seems to help me switch activities, for a couple reasons…

I can find the right place for the task at hand

I find coffee shops a little distracting when I need to really focus hard on a single task, but they’re great for a series of short, repetitive tasks. I get to enjoy a latte while I churn through emails that I’d otherwise pick at throughout the day. I don’t code or design very well without a second monitor, so that focuses me even further. My 13-inch laptop screen is pretty well suited for communications, and not a whole lot else.

The physical shift becomes a “switching ritual” that signals my brain that it’s time to start thinking differently.

There’s something about the change in surroundings that seems to make it easier to quiet down whatever gears are still spinning from the last activity and re-focus on a new task.

You can’t always move to another location

It’s not practical to go to a different physical location for each task. You’ll probably get the most benefit if you can identify a single activity that has a high potential for derailing the rest of your day and banish that to another location from your other work. Sometimes, though, you just can’t get away. Here are some other ideas for altering your environment:

  • Have different desk configurations. Try moving your monitor from one side of the desk to another as you shift tasks. Maybe a totally clear, uncluttered desk works better for certain activities, while a desk full of pictures and knick-knacks works better for others. The act of switching configurations might be just enough to jog your brain into a different mode. It’s sort of the “hyper-functionible workplace” version of this. For example, I have an adjustable-height desk, and I usually do my coding-thinking while standing, but designing while sitting.
  • If you work from a laptop, you can almost certainly find an unused space in your office that you can switch to without being too disruptive.
  • If you can’t change your environment, just get out of it for a while. Go for a walk, or do anything else to signal to your brain that it’s time to start acting differently.

Your turn:

Have you ever gotten any benefit from location boxing your activities? I’d love to hear how. Let me know in the comments.

Further reading:

Transitioning Projects, or searching for a state of flow.

Maker’s Schedule, Manager’s Schedule


Can we talk for a minute about why email sucks so much?

email-sux

Consider the following scenario: You’ve been working hard all day, feeling like you’re being productive, and you look up at the clock and see that it’s 5pm. A strange feeling washes over you, as you realize you have no clue how it got so late, and you can’t make sense of where your day went. It’s just an unexplainable 8-hour blur.

That feeling sucks. It sucks so badly, in fact, that it’s one of the reasons we built RescueTime, so we could understand what was actually going on with our days.

Have you ever had a day like that? If so, I’ll let you in on a secret…

If you’re like most people who spend their days at the computer, those days probably have a lot to do with email.

Email has become the glue that ties our workdays together. We can communicate with pretty much anyone, anywhere, anytime. Interactions that used to require scheduling a face to face meeting or phone call can be handled asynchronously. All things considered, it’s pretty amazing. But, that ease of communication can create a deluge that can drag down your entire day if you’re not careful.

In the average 5-day work week, about a day and a half of it is spent on email

That’s right. Email takes up around 28% of the average desk worker’s day. This has borne out in several studies, and we’ve seen similar numbers across our user base. That’s just shy of two and a half hours in an eight hour day (or 11.2 hours per week) It may seem like a lot, but even that number doesn’t tell the whole story. There are many factors that cause email to take a huge toll on our productivity, even if you have the best spam filters. Being aware of these can help you avoid falling into some serious productivity traps.

Three reasons email sucks

One: Switching tasks all day comes at a price

multitasking

For many people, email is always on. It’s a ubiquitous layer on top of any other work that’s happening. Either there is a browser tab open with Gmail, or Outlook is running in the background, just to make sure nothing important gets missed. It’s pretty easy to think “it’ll just take a minute to respond to this email, that’s not hurting my productivity that much.” Besides, if you aren’t responsive, aren’t you dragging down other people’s productivity who may be waiting to hear back from you?

First of all, all those quick responses throughout the day add up. We tend to be really bad at estimating the sum total of time that it takes.

But it gets worse… that one minute it takes to respond is just the starting point. You then have to get back to what you were working on, and that’s surprisingly harder than it seems. That “re-focusing time” has been the subject of numerous studies, and has been shown to last anywhere from one to twenty-three minutes. Even more troubling, there are many tasks that are simply never returned to after dealing with the interruption.

Part of the reason for this refocusing lag may be that the way we use email forces our brains to work differently. The randomness of email, and our desire to be responsive, causes our brains to switch to a state of high-alert, continually on the lookout for new input. Most of that activity takes place in a part of the brain called the amygdala, which is where our fight-or-flight response comes from. That’s different from how our brains tend to act when we’re in a state of flow or deep thought, with most of the activity occurring in the pre-frontal cortex. [source]

With that in mind, the cost of always-on communications starts to become more apparant.

Two: Email is always unfinished business

infinity-emailChances are, if you look at your job description, “managing your inbox” probably isn’t listed as one of your primary duties. But the problem with email is that it’s a never ending task. There are always new emails coming in, and when you respond to an email, it usually results in a response back. The cycle just keeps spinning. Since your inbox keeps filling up, it’s easy to let it occupy a permanent, growing space in your mind. As you work on other tasks (probably the ones that actually are on your job description), your inbox which may or may not be exploding with something important sticks around in your mental space, causing a huge distraction. I’ve often found myself mid-stream on a project, then unconsciously tabbing over to my email, sometimes several times a minute. It’s infuriating.

There’s a psychological explanation for this, called the Zeigarnik Effect, which summarized as:

“It seems to be human nature to finish what we start and, if it is not finished, we experience dissonance.”

Three: Email is a one-stop shop that’s full of distractions

wenger_giant_knifeI’ve heard email described as “a firehose that we have to drink from”, and it’s certainly ubiquitous. It’s become a hub for our entire work day. It’s a single place that we’ve organically grown to use for many different reasons. It’s for communicating with your colleagues. And your customers… And personal communications… And it’s your task list (“I’ll just leave this in my inbox so it’ll remind me to follow up”)… And it’s your knowledge base (“I’ll just email this to the group to spread the knowledge around”)… Sometimes it’s a file system (“I’ll need this file tonight at home, so I’ll just email it to myself”)… On top of all of that, it’s the default notification repository for pretty much any other system you might be using.

The number of use-cases you can shoehorn email into is impressive. There’s a certain elegance to it, too. It’s this single place that you can keep an eye on everything. The downside of that, is that every time you go into it, you have to contend with that “everything”, even if you’re only trying to focus on one specific thing.

Instead of a boutique shop, it’s a Wal-Mart.

So what to do about it?

Ok, ok, It’s real easy to opine about how much email is overwhelming and problematic. There are countless blog posts about it. I even spoke at a conference devoted to it last week. The trickier part is figuring out practical ways of dealing with it. In most cases, you generally can’t easily just stop using it. It would be really disruptive to your company, and unless you’re the CEO, you can’t really get away with being that weirdo that says “oh, don’t send me an email, I won’t read it.”

The bummer is, there’s not a single solution that works for everyone. That said, with a little trial and error, it’s easy to find some strategies that will work for you. Here are several ideas and resources to get you started.

Optimize your inbox to support good habits

If you use Gmail, here’s a way to set up your inbox that pretty much forces you out of the habit of letting things just pile up. If you read a message, it disappears unless you take action on it. I’ve been using this one for the past few weeks and it’s great.

Set up some metrics to monitor your inbox health

Here’s a look at how one knowledge worker visualized the state of his inbox to understand how it was getting out of control.

With RescueTime, you can see exactly how all that time adds up. Here’s a post explaining one of our communication reports that helps you understand your communications time.

If you want to get hardcore about it, use Beeminder to make a financial commitment to shrinking your inbox (and get some interesting stats along the way).

Turn off all your notifications

Many changes to your email use require cultivating a new habit, or getting used to a new piece of software. This tactic is great because it simply means turning a bunch of stuff off. Take 10 minutes to go through all your devices and turn off everything that beeps, buzzes, blinks, or bounces in your dock. I did this last year, and after a few days the difference it made was so great that I’ll never go back.

Shift your communications elsewhere

When I read Claire Burge’s recent article about funneling all her communications away from email to other systems, I was skeptical. I mean, pushing all your personal communications to Twitter or Facebook seems even worse, right? You’re moving your communications to a platform that has distraction baked directly into their business model! And isn’t having your business communications spread across five project management systems obviously much less efficient than having everything in a single place?

On the other hand, if you are going to Facebook to deal with personal communications, it doesn’t really matter that you’re getting distracted, because social interaction is the whole reason you went there in the first place. Similarly, when you go to Basecamp to interact with a customer, you’re in an environment that’s walled off from anything not related to that customer. Perhaps most interestingly, when you do this, you allow email to stop being this over-crowded place that constantly needs monitoring. Breaking it up into smaller silos, it forces you to treat communications as a set of distinct tasks, rather than a single monolith that won’t ever be finished, no matter how much effort you put in.

So try moving your personal communications to Facebook, or your work-related discussions to LinkedIn. If it’s practical, try to shift your project related discussions to a dedicated project management environment like Basecamp or Asana.

For more inspiration, here’s another account of a CEO’s journey into a world without e-mail.

Let the robots do the work for you

Boomerang gives you some power-user tools that let you offload some of the mental overhead of email. The company who makes it also makes Inbox Pause (which does exactly that, pauses your inbox until you’re ready for new messages), and the Email Game (a nifty little game which forces you to work through your inbox).

You can also use a service like Unroll.me or Sanebox to move all your bulk email to a single place, allowing you to focus on personalized communications while you’re in your inbox. AwayFind is another option, letting you set up smart notification alerts so you don’t have to worry about missing important emails.

That’s not an exhaustive list of tactics, but it’s a starting point. Here’s some further reading:

What do you think?

I’m curious what strategies you’ve found to cope with email overload. Have you found anything that seems to work particularly well? If so, let us know in the comments!