"No conversations selected." error when archiving messages from conversation view

821 views
Skip to first unread message

Brandon High

unread,
Apr 3, 2008, 5:24:55 PM4/3/08
to GMail Power Users
I'm using Brent's modified-gmail-macros-alt.user.js from 2/4/2008.

The error occurs when reading a message from the Inbox. When using "e"
to archive a message from conversation view, the message is archived,
the view returns to the inbox view, and the error "No conversations
selected." is displayed. It's as if the macro is trying twice to
archive.

If there were checked messages in the inbox view, they will be
archived, and using the Undo link will only undo the checked messages,
not the one that was being viewed.

When viewing messages from a label or search, using "e" at the
conversation view will remove the message from the Inbox, but keep the
message view open, and the Undo link will be displayed.

I believe the error is because the default behavior is different when
viewing a message from the inbox vs. a label or search. Using the
Archive button from an inbox message will return you to the inbox.
Using the button from a search/label message will remove the message
from the inbox but keep the message open.

I think that the return value of doButton(ARCHIVE_ACTION) is not
properly detected because the view changes, so the script is then
calling cmami(ARCHIVE_ACTION), which either fails because no
conversations in the inbox view are checked, or archives anything
that's checked and discards your most recent undo.

In fact, adding an alert to the code, like such:

if (button) {
simulateClick(button, "click");
alert("doButton: true");
return true;
}

causes the archive call to work properly (the Undo link is presented),
but once you dismiss the popup, another archive attempt is called and
the error message is displayed.

A simple fix is to modify the ARCHIVE function to only call cmami():

'ARCHIVE': {
cat: 'GENERAL',
desc: 'Always archive',
func: function() {
cmami(ARCHIVE_ACTION);
}
},

There may be a better way by checking if the view changed, but I
haven't looked into it.

sewpafly

unread,
Apr 3, 2008, 8:17:41 PM4/3/08
to gmail-po...@googlegroups.com
That's interesting, and it actually goes along with a buggy behavior
that I've seen when using the read&archive macro ('E'). However, I
don't think that it's because of the doButton code... I believe the
behavior is actually caused from Gmail using a different method to
trap the 'e' keypress (which also traps on shift+e) than they use
everywhere for other actions, or a bug in my script from taking too
long (allowing gmails handler to trap it before I do)...

I've been meaning to see if I can find a way around it, but haven't
had time to look into it. If anyone has a solution I'd love to hear
it.

sewpafly

unread,
Apr 3, 2008, 8:39:57 PM4/3/08
to gmail-po...@googlegroups.com
Although, after playing with it some more, you seem to be right about
the archive button too... I need to find some time to play with this.
Reply all
Reply to author
Forward
0 new messages