Tryretepmu wrote:I like to use a shortcut, which executes a sequence of commands of different contexts.
Example for such a task:
"The user knows that he will reply (in the future), but he has no time (at the moment) to write the message immediately. He uses the (content of the) sent folder as a reminder."Code: Select all
goDoCommand("cmd_reply");
goDoCommand("cmd_saveAsDraft");
goDoCommand("cmd_close");
goDoCommand("cmd_nextUnreadMsg");
That code executes only the function of the first line.
My question:
The first line needs the context "main window".
The second a third line need the context "draft window", while the fourth line again needs the context "main window".
How can I realize a shortcut for the described task please?
Code: Select all
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var Listener = {
onWindowTitleChange: function(){}, onCloseWindow: function(){},
onOpenWindow: function(aWindow){
wm.removeListener(this);
this.compose = aWindow.docShell
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindow);
this.compose.addEventListener("compose-window-init", this, true);
},
handleEvent: function(event){
event.currentTarget.removeEventListener(event.type, this, true);
event.currentTarget.gMsgCompose.RegisterStateListener(Listener);
},
NotifyComposeFieldsReady: function() {},
NotifyComposeBodyReady: function() {
this.compose.gMsgCompose.UnregisterStateListener(this);
this.compose.window.setTimeout(function(){
this.goDoCommand("cmd_saveAsDraft");
this.goDoCommand("cmd_close");
goDoCommand("cmd_nextUnreadMsg");
},0);
}
}
wm.addListener(Listener);
goDoCommand("cmd_reply");
You can't change the existing shortcut since it has been implemented as an EventListener instead of a <key>, but you can Add a new key containingjerdna wrote:hi, my shortcut for panorama (ctrl+spacebar) doesnt work... can you please tell me how can i change that short cut into alt+spacebar or F1.
Code: Select all
TabView.toggle();