Brandon High
unread,Apr 3, 2008, 5:24:55 PM4/3/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.