Gmail V2 and Gmail Macros

95 views
Skip to first unread message

voyagerfan5761

unread,
Oct 29, 2007, 9:49:37 PM10/29/07
to GMail Power Users
Some users have been getting "Newer Version" and "Older Version" links
in their Gmail accounts that switch between the current Gmail
interface and a newer one, in testing. There is a new version coming,
as Google announced at Google Analyst Day 2007 last week, and it will
have a completely different JavaScript base. Is anyone up to updating
the various Gmail Macros scripts to work with the new version, once it
becomes available to them? Unless of course, Google takes my
suggestion and includes Gmail Macros natively in the new version of
Gmail...

sam_j

unread,
Oct 30, 2007, 1:43:52 PM10/30/07
to GMail Power Users
I do know that my Macros are not working on the new version, though I
quite like the new version. Sharp. I'll stick with the old version
until macros are brought up to date though, they are absolutely
essential.

Brent Nef

unread,
Oct 30, 2007, 3:14:29 PM10/30/07
to GMail Power Users
I'd give a try on updating gmail macros, but I don't have the "new"
version option...

voyagerfan5761

unread,
Oct 30, 2007, 3:53:12 PM10/30/07
to GMail Power Users
With so many different versions of the script, though, updating might
be a bit more difficult. As for the interface, I wish Google would
roll out new features more quickly; I don't even have IMAP yet.

Which script variant should get priority? The one included in
Lifehacker's Better Gmail? Mihai's original? Yours? This is
complicated...

Brent Nef

unread,
Oct 30, 2007, 5:28:48 PM10/30/07
to GMail Power Users
I think that mine is actually the one used in Better Gmail (the
changelog says it was taken at 0.4), which I combined the latest (at
the time) changes from Mihai's script. Regardless, the changes will
all affect the same spot: the scripts create an alternate "more
actions" menu and then fire that off. Since I don't have the new
version I'm not sure how that interface has changed and what sort of
differences there are between old and new, but presumably this action
menu still exists.

voyagerfan5761

unread,
Oct 30, 2007, 11:10:51 PM10/30/07
to GMail Power Users
>From what I've read and the screenshots I've seen, the more actions
menu has been changed from a select menu to a layer; it looks a lot
like the menus in Google Reader, if you're familiar with those, though
I don't know if the code is at all similar.

sam_j

unread,
Nov 4, 2007, 2:33:40 PM11/4/07
to GMail Power Users
Are folks working on this? I'd be happy to pitch in, if someone will
point me in the right direction in terms of resources, GMAIL's API (is
there one?) and that sort of thing. I seriously need the macros to
survive, and I don't want to give up all the niftiness of the new
version.

cave...@gmail.com

unread,
Nov 4, 2007, 7:09:40 PM11/4/07
to GMail Power Users
I've tried to take just a small portion - the key assignment part of
the gmail macros - and see if I could get the label hotkeys to work.
I'm afraid I'm at a loss in the new environment.

I also took a stab at Gmail Colored Labels, but couldn't seem to
locate the particular div elements that hosted the place where labels
appear in front of messages.

I'm willing to help - or at least document how to help - if someone is
willing to figure out the programming.

Doug Harris

unread,
Nov 5, 2007, 5:48:31 PM11/5/07
to GMail Power Users
Which version are you working from?

There are a bunch listed at http://groups.google.com/group/gmail-power-users/web/gmail-macro-version-info

On Nov 4, 7:09 pm, "caveat...@nospam.gmail.com" <caveat...@gmail.com>
wrote:

sam_j

unread,
Nov 6, 2007, 7:53:41 AM11/6/07
to GMail Power Users
I'm using Mihai's original one, but I'd be happy to contribute to
whichever consensus deems to best fit for a version two. I know how
to code, but I don't a clue about where to begin in interfacing with
gmail -- most of my experience is offline.

I take it that google does not document interfacing with gmail -- do I
just check out the pagesource and tinker through it? Or is there a
more intelligent way of doing this?

On Nov 5, 3:48 pm, Doug Harris <dhar...@gmail.com> wrote:
> Which version are you working from?
>

> There are a bunch lis169.254.9.22ted athttp://groups.google.com/group/gmail-power-users/web/gmail-macro-vers...

Brent Nef

unread,
Nov 6, 2007, 10:22:10 AM11/6/07
to GMail Power Users
Mihai put out a new Gmail Macros script for gmail 2.0, I'll update the
page... http://groups.google.com/group/gmail-power-users/web/gmail-macro-version-info

If I ever get the new version I'd like to add my code that makes the
keys configurable, and add an interface to change those mappings as
well.

phirschybar

unread,
Nov 6, 2007, 10:23:53 AM11/6/07
to GMail Power Users
oh heaven's YES!

On Nov 6, 10:22 am, Brent Nef <brent....@gmail.com> wrote:
> Mihai put out a new Gmail Macros script for gmail 2.0, I'll update the

> page...http://groups.google.com/group/gmail-power-users/web/gmail-macro-vers...

Michael Kizer

unread,
Nov 6, 2007, 11:18:13 AM11/6/07
to gmail-po...@googlegroups.com
On 11/6/07, Brent Nef <bren...@gmail.com> wrote:

Mihai put out a new Gmail Macros script for gmail 2.0, I'll update the
page... http://groups.google.com/group/gmail-power-users/web/gmail-macro-version-info

If I ever get the new version I'd like to add my code that makes the
keys configurable, and add an interface to change those mappings as
well.
Cool, thanks Brent.

I'm waiting for the new version of Gmail as well. Too bad Mihai couldn't just work his code into the base, like he did partially for Google Reader.


--
~Michael Kizer
http://Michael.Kizer.ws

Carl M

unread,
Nov 6, 2007, 12:42:12 PM11/6/07
to GMail Power Users
Since this is an emergency for many of us, I'm posting a quick
modification to Mihai's script; Brent, maybe this will help you a
little:

http://www.math.rochester.edu/people/faculty/cmlr/gmail-new-macros.Mihai.CM.user.js

I modified a few of Mihai's bindings,

L unlabel
r mark as read
R mark as unread

I also put in some code so that people can rebind keys. That is, for
small letters, use the numbers such as '71' for g. For capital
letters, use put 's' at the end, so '71s' is G. The code for the 's'
is on line 252, where I added

k += (event.shiftKey) ? "s" : "";

Also, line 23 has

var MARK_AS_UNREAD_ACTION = "2";

I guess all actions have numbers. One could figure them out by trial
and error, if nothing else. Lines 81-87 have the functions for read
and unread.

This file doesn't include Brent's other innovations. It doesn't have
a help box, but that should be easy to add by copying from the
previous script. Knowing the numbers for the other events would be
nice.

Carl

puzzler

unread,
Nov 6, 2007, 12:55:01 PM11/6/07
to GMail Power Users
Thanks for the new macro script. Unfortunately, I really don't care
for the new two and three-key combinations for my most common
commands. I miss being able to use "t" for trash. Also, "shift-8-u"
for select all unread messages seems excessive. I used an old script
that used "mu" for selecting all unread messages, but a one-key macro
for that would be ideal to me.

Too bad Gmail's system doesn't make it easier to configure these
keyboard shortcuts.

Carl M

unread,
Nov 6, 2007, 2:01:14 PM11/6/07
to GMail Power Users
It grates on me that these new keyboard shortcuts are so illogical.
This is one of my main complaints about Yahoo mail. I suppose
"shift-8" is "*" which is supposed to look like a mark, or maybe "#"
is like crossing out. But "shift-i" for read? I guess it's next to
"shift-u" for unread. Mihai has shortcuts like "b" for remove label.
Of course, we're all indebted to him. But it's really essential to
let people set up their own shortcuts, and it's the polite thing, too.

Carl

Carl M

unread,
Nov 6, 2007, 4:16:02 PM11/6/07
to GMail Power Users
Sorry, in my macros "r" conflicts with reply, if you're reading a
message. I'll remove that but leave the rest as is. In the previous
scripts people were able to make "r" behave differently when viewing a
message, so I hope someone will find a way to do this again.

Carl

voyagerfan5761

unread,
Nov 6, 2007, 4:28:20 PM11/6/07
to GMail Power Users
I just posted a comment to Mihai's blog asking if he'll add new label
functionality to an "official" build of the script, and also
(jokingly) if he'll convince the Gmail Team to add Macros to the
mainstream code. We'll see what he says...

If he says no or doesn't answer, I think we'll just have to get Brent
Nef back here to go over the code and reinvent his wheel... :)

Mohamad Alhomsi

unread,
Nov 6, 2007, 4:55:13 PM11/6/07
to gmail-po...@googlegroups.com
please I really need this shortcut key. pleeeeeeeeeeeeeeeese.
many times there will be that email that you want to delete from the conversation

"delete this message"

shrutes

unread,
Nov 6, 2007, 5:20:19 PM11/6/07
to GMail Power Users
Have we figured out how to override the new gmail shortcuts yet? i.e.
the shift+i and the shift+8? Customizing the old script was so much
easier...

On Nov 6, 1:55 pm, "Mohamad Alhomsi" <peacebeupon...@gmail.com> wrote:
> please I really need this shortcut key. pleeeeeeeeeeeeeeeese.
> many times there will be that email that you want to delete from the
> conversation
>
> "delete this message"
>

> --
> Mohamad Alhomsi
> 7066277577

sam_j

unread,
Nov 6, 2007, 5:39:23 PM11/6/07
to GMail Power Users
Just want to put a thank you out there for fast update on the macro!

mathalot

unread,
Nov 7, 2007, 8:05:37 PM11/7/07
to GMail Power Users
I don't know if this helps people with extending Mihai's script, but
he linked to some code that might be of interest <a href="http://
code.google.com/p/gmail-greasemonkey/wiki/
GmailGreasemonkey10API">here</a>.

mathalot

unread,
Nov 7, 2007, 8:07:14 PM11/7/07
to GMail Power Users
I'm sorry, here's the link in a more usable form:

http://code.google.com/p/gmail-greasemonkey/wiki/GmailGreasemonkey10API

Brent Nef

unread,
Nov 7, 2007, 9:34:07 PM11/7/07
to GMail Power Users
http://groups.google.com/group/gmail-power-users/web/gmail-macros-new-bn.user.js

I got updated to the new gmail and I've added a bunch of the old
mappings. I'm kind of embarrassed to put this out because it's so
rough and I'm probably going to get rid of most of my changes.
However the primary reason I'm putting it out there now is because I
can't seem to "override" the events. I found this because when you
try to do 'X'+a (select all) or any of these, gmail fires the 'x'
event handler anyway. event.stopPropagation() doesn't work, nor does
changing the capture flag when you create the event handler. I would
appreciate any ideas on the subject. It should work somehow because
Mihai overrides the 'g' command...

Either way, if you change all the commands to something that gmail
doesn't use, it works.

voyagerfan5761

unread,
Nov 8, 2007, 1:45:33 AM11/8/07
to GMail Power Users
Dude...You rule! Sorry, Mihai, but your script is toast now that
Brent's updated his. :D

I tried to poke around in the code a bit to see if I could fix a few
bugs (like those annoying alerts on action failures [comment out the
alert() calls in the simulateClick() function]), with a little
success. I did notice that Mihai used keycodes while you have actual
letters. That difference could be the key to overriding Gmail's
default shortcuts. I don't know for sure, since I'm mainly a
GreaseMonkey user, but it's an idea.

Also, is there a way to make sure conversations are selected before
trying to apply an action with simulateClick()? That would eliminate
a lot of errors that pop up on accidental calls to macros that require
a selection.

I don't know how much collaboration and/or cooperation we can expect
from the Gmail Team, but perhaps they could add to the unofficial API
object methods that access common actions like marking read/unread,
starring/unstarring, etc. to make more complex macros easier? Then I
could make myself a macro to take a message, mark it as read, unstar
it, and archive... Just an idea.

On Nov 7, 8:34 pm, Brent Nef <brent....@gmail.com> wrote:
> http://groups.google.com/group/gmail-power-users/web/gmail-macros-new...

voyagerfan5761

unread,
Nov 8, 2007, 8:41:30 PM11/8/07
to GMail Power Users
Brent, I've found a little thing with your macros that shows up when
selecting "none" messages. Shift-8, n results in unmarking all
messages, then the "New Label..." function, which fails because no
messages are selected. I noticed that it is not Shift-N that triggers
"New Label..." but just "n"; I fixed it by changing the key for the
new label action to "N" (I like the easy customization, by the way).
I don't know if you want to update the version uploaded here, but I
thought I'd let you know. Maybe it's just a typo. Cheers!

Mark Engelberg

unread,
Nov 9, 2007, 6:23:58 PM11/9/07
to gmail-po...@googlegroups.com
When using this script, I get an error message when I hit 'r' to reply
a message ("couldn't find menu item node 'mark as read'").

On Nov 7, 2007 6:34 PM, Brent Nef <bren...@gmail.com> wrote:
>
> http://groups.google.com/group/gmail-power-users/web/gmail-macros-new-bn.user.js

Ben Hirsch

unread,
Nov 9, 2007, 7:16:06 PM11/9/07
to gmail-po...@googlegroups.com
I get that too.


--
Ben Hirsch

Carl M

unread,
Nov 9, 2007, 7:25:36 PM11/9/07
to GMail Power Users
Brent has already fixed that problem, download the current version.

Carl

On Nov 9, 7:16 pm, "Ben Hirsch" <benhir...@gmail.com> wrote:
> I get that too.
>

> On 11/9/07, Mark Engelberg <mark.engelb...@gmail.com> wrote:
>
>
>
> > When using this script, I get an error message when I hit 'r' to reply
> > a message ("couldn't find menu item node 'mark as read'").
>

> > On Nov 7, 2007 6:34 PM, Brent Nef <brent....@gmail.com> wrote:
>
> >http://groups.google.com/group/gmail-power-users/web/gmail-macros-new...
>
> --
> Ben Hirsch

Brent Nef

unread,
Nov 10, 2007, 2:00:47 PM11/10/07
to GMail Power Users
Okay, I made it so you can override the default actions of gmail. I'm
going to add the help interface and combine that with a tool to
configure the keys next. Keep me apprised of any more bugs.

Carl found/fixed the 'r' problem, and suggested the mapping for new
label be changed to 'N'... I made these changes, but gmail has the
same key (shift+n) mapped to "update conversation" when you have a
message waiting, so I might change it back. Any thoughts?

Carl M

unread,
Nov 10, 2007, 9:13:15 PM11/10/07
to GMail Power Users
Definitely, change it back. But in conversation view, "n" is for
"next", you should use

//New Label
'n': function() {
if (gmail.getActiveViewType() == 'tl') {
clickMoreActionsMenuItem("New label...",NEW_LABEL_ACTION);
}
},

to allow the mapping only when looking at threads.

Carl

Brent Nef

unread,
Nov 10, 2007, 10:40:03 PM11/10/07
to GMail Power Users
I still add new labels from the conversation view too, so I don't know
what the best thing to do is here. Maybe add a keymapping for the
update conversation that you can set that too.

voyagerfan5761

unread,
Nov 11, 2007, 12:50:43 AM11/11/07
to GMail Power Users
I agree, it's necessary to have new label functionality within a
conversation, too. Perhaps the key should just be changed. Does
Gmail use "w" for anything?

Carl M

unread,
Nov 11, 2007, 10:14:20 AM11/11/07
to GMail Power Users
I recommend "U" for "update conversation". This fits with "u", which
means return to the thread list and update it. Then keep "N" for "new
label".

Carl

Mohamad Alhomsi

unread,
Nov 11, 2007, 2:32:13 PM11/11/07
to gmail-po...@googlegroups.com
that is right . "U" should for updating ..

thakn you

bcleme...@gmail.com

unread,
Nov 11, 2007, 4:18:48 PM11/11/07
to GMail Power Users
Hi guys,
And what about the great Shift+e shortcut to mark as read and
archive ?
Do you think this would be introduced in this new version of the
script ?

Tks

On 11 nov, 20:32, "Mohamad Alhomsi" <peacebeupon...@gmail.com> wrote:
> that is right . "U" should for updating ..
>
> thakn you
>

> On Nov 11, 2007 9:14 AM, Carl M <carl0muel...@gmail.com> wrote:
>
>
>
>
>
> > I recommend "U" for "update conversation". This fits with "u", which
> > means return to the thread list and update it. Then keep "N" for "new
> > label".
>
> > Carl
>
> > On Nov 11, 12:50 am, voyagerfan5761 <voyagerfan5...@gmail.com> wrote:
> > > I agree, it's necessary to have new label functionality within a
> > > conversation, too. Perhaps the key should just be changed. Does
> > > Gmail use "w" for anything?
>
> > > On Nov 10, 9:40 pm, Brent Nef <brent....@gmail.com> wrote:
>
> > > > I still add new labels from the conversation view too, so I don't know
> > > > what the best thing to do is here. Maybe add a keymapping for the
> > > > update conversation that you can set that too.
>

> --
> Mohamad Alhomsi
> 7066277577

Brent Nef

unread,
Nov 11, 2007, 10:58:18 PM11/11/07
to GMail Power Users
I think Mihai had it mapped to 'd'. I didn't change it initially, but
my latest one does have 'E' as read/archive.

On Nov 11, 1:18 pm, "zleban...@gmail.com" <bclementz...@gmail.com>
wrote:

Andy O

unread,
Nov 12, 2007, 3:36:11 PM11/12/07
to GMail Power Users
Hi all:

Love this script BTW. Am using the latest Brent Nef script and I have
question. Is there a shortcut to "Delete Forever" specifically for
the Spam label?

voyagerfan5761

unread,
Nov 12, 2007, 7:35:25 PM11/12/07
to GMail Power Users
There isn't one that I know of. I don't know if it helps, but the
"Delete forever" button has an 'act' attribute of '17'. (Sounds like
Google's code wouldn't validate?)

voyagerfan5761

unread,
Nov 14, 2007, 2:21:23 AM11/14/07
to GMail Power Users
Ooh, Brent, I like your help screen in version 20071113.1 of your
Macros. I don't suppose you could anchor the window to the top of the
browser rather than the bottom? Having the section links jump around
is bad for usability. Other than that, it's phenomenal!

Reply all
Reply to author
Forward
0 new messages