Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

Gmail Unlabelled

This script adds 'Unlabelled' at the end of the labels list to search for unlabelled conversations

This is a greasemonkey script to search for unlabelled emails in gmail.

  • It adds a speal label 'Unlabelled' at the end of the labels list
  • One could also use '-label' in the search field
See this page for more information. Most queries would have been answered there. NOTE: I'll personally answer only those that haven't been answered before.

For the new version of gmail, see gmailUnlabelled2.




Nov 8, 2007
queyas Scriptwright

var label_none = document.createElement('div');
label_none.setAttribute ("id", "sc_unlabelled");
label_none.setAttribute ("class", "lk cs");
label_none.setAttribute ("title", "unlabelled");

instead of:

var label_none = edit_labels.cloneNode (true);

label_none.setAttribute ("id", "label_none");

works better, for example with Gmail Air Skin

 
Nov 12, 2006
Tim Wilson Scriptwright

I've discovered you can filter out sent mail by adding "!is:sent" to the search string. However, the script can also be modified to automatically filter out sent mail. On line 45 of the script, str is set to ''. If you put !is:sent between the single quotes, that filters out sent mail, or at least individual sent mails. I'm not sure if it filters out sent mail that was part of a conversation.

 
Nov 8, 2006
Tim Wilson Scriptwright

Is there a way to not show Sent Mail? I've got hundreds of unlabeled messages, and it looks like a majority are sent messages. If I could filter those out, it would help immensely.

 
Aug 16, 2006
Jaidev Script's author

Kyle, that is not possible. See my earlier reply.

 
Aug 1, 2006
Kyle Wilson 3 User

Is there any way to tweak this to show only complete conversations lacking labels? A labeled email I reply to causes the whole conversation to show up when I click on "unlabeled." This doesn't really help me identify what's unlabeled.

 
Mar 28, 2006
Andy S. User

Could the script include -from:[your@emailaddress.here]? This would be useful for me - I'd like to only see received messages that are unlabled, since all sent items are. I would edit the script myself, but I'm not sure how I'd put that in correctly...

 
Mar 17, 2006
Jaidev Script's author

When you apply a label to a conversation, all emails get that label.

The problem is when another email arrives later and is grouped into the same conversation. This email doesn't have a label technically. It is an illusion ;-)

 
Mar 15, 2006
Vik User

I don't get it. I thought labels only applied to conversations, not individual emails?

 
Mar 5, 2006
Jaidev Script's author

If a conversation has atleast one email that is unlabelled then this conversation turns up under the unlabelled search. It is a one time task to label all such conversations.

(The previous comment was misleading).

 
Mar 4, 2006
Jaidev Script's author

Multiple labels are not treated as unlabelled. If you see a conversation with a label in the results, then one (some) of the emails in the conversations hasn't been labelled.

 
Mar 3, 2006
mbaluyos User

useful script. thanks.

it still tags emails with *multiple labels* as "unlabelled." i seem to have a lot of them so i still have to go through pages just to sort my "unlabelled" mail.

i hope this gets fixed.

 
Feb 28, 2006
ycc2106 User

Excellent, this helped me clean up! I would give it 5 stars if rating worked: ***** ;)

 
Jan 19, 2006
Jaidev Script's author

Okay, the script now handles labels with an &

 
Jan 15, 2006
Daniel Tilkin User

Can you please also change '&' to a '-'. Making this change manually in the search works. Thanks.

 
Jan 12, 2006
Jaidev Script's author

Fixed the issue with slashes. I don't use many special characters in my labels, so if anyone finds issue with any other special character, please let me know.

I don't want to try out every special character myself ;-)

 
Dec 28, 2005
Daniel W. Cr... Scriptwright

Seems to fail with spaces in the Label names, it should quote them.

Example: -label:[Z]-Plaxo -label:[Z]-New House -label:[Z]-Jobs

 
Dec 21, 2005
AWK User

Script fails with labels that contain several spaces or slashes '/'. Please consider to use "replace(/[/\ ]/g, '-')" instead of "replace(' ', '-')".

 
Dec 19, 2005
Jaidev Script's author

<quote>
Also, the button disapears when you have read a mail, and then click "<< Back to something"...
</quote>

I knew this, it was due to gmails way of prefetching pages. Anyways, I've worked around it now.

Also changed the _ to a -.

 
Dec 15, 2005
Niklas Scriptwright

A script that makes searched mail take only one line, like everywhere else, would be nice here.
Also, the button disapears when you have read a mail, and then click "<< Back to something"...

 
Dec 12, 2005
J-Mac User

The script needs to be edited. It currently changes any spaces to underscores, when they need to be dashes.

So:

" ","_"

needs to be changed to:

" ","-"

 
Dec 5, 2005
Jaidev Script's author

> madcow says on Monday, December 05 2005
> When I click on unlabeled it has stuff in
> the search that does have a label...

Thats because some messages may not have been labelled in the conversation. I found this strange too.

 
Dec 5, 2005
AWK User

IMO the 'unlabeled' should not include mails which are in the 'Inbox'. For me I added '-label:Inbox' to the search in the script.

 
Dec 5, 2005
madcow User

When I click on unlabeled it has stuff in the search that does have a label...

 
Dec 5, 2005
Jaidev Script's author

Gotcha!

If you have a multi word label, to search by it, I've to use _ instead of spaces. Fix coming up in a few minutes ;-)

Thanks a lot!

 
Dec 5, 2005
Daniel Bunyard User

I finally got it. You need a dash, "-" to replace the space in multi-word labels. From what I can tell, this should fix it. I'm not sure thought. Google has a strange way of searching.

You could comment on this script if you were logged in.