keyconfig 20110522
-
- Posts: 6188
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@pacocasc
Are you using tbkey or tbkeys-lite?
You cannot run arbitrary javascript with tbkeys-lite.
You can use the cmd shorthand and func shorthand with tbkeys and tbkeys-lite.
Use the cmd shorthand for calling a command using the goDoCommand method.
For example, "cmd:cmd_nextMsg" is the same as "window.goDoCommand('cmd_nextMsg');".
Use the func shorthand for calling a function on the window object without a parameter.
For example, "func:MsgNewMessage" is the same as "window.MsgNewMessage();".
There is a tbkeys.xpi link on the GitHub releases page.
Troubleshooting: viewtopic.php?p=14872763#p14872763
Are you using tbkey or tbkeys-lite?
You cannot run arbitrary javascript with tbkeys-lite.
You can use the cmd shorthand and func shorthand with tbkeys and tbkeys-lite.
Use the cmd shorthand for calling a command using the goDoCommand method.
For example, "cmd:cmd_nextMsg" is the same as "window.goDoCommand('cmd_nextMsg');".
Use the func shorthand for calling a function on the window object without a parameter.
For example, "func:MsgNewMessage" is the same as "window.MsgNewMessage();".
There is a tbkeys.xpi link on the GitHub releases page.
Troubleshooting: viewtopic.php?p=14872763#p14872763
-
- Posts: 10
- Joined: November 19th, 2020, 9:38 am
Re: keyconfig 20110522
I use tbkey (no tbkeys-lite). I've been using the function you helped me create (to mark a message as answered), without problems for the last 3 years. Now, when Thunderbird was updated to 115.4.1 it stopped working.
I tried changing to the following (without the newline characters), but marking a message as answered still doesn't work (It doesn't mark it as an error but it doesn't do anything)
Code: Select all
(function () {
var msgHdr = window.gFolderDisplay.selectedMessage;
if (msgHdr.flags & window.Components.interfaces.nsMsgMessageFlags.Replied) {
msgHdr.folder.msgDatabase.MarkHdrReplied(msgHdr, false, null);
} else {
msgHdr.folder.msgDatabase.MarkHdrReplied(msgHdr, true, null);
}
msgHdr.folder.msgDatabase = null;
})();
Code: Select all
(function () {
var msgHdr = window.gTabmail.currentAboutMessage.gMessage;
if (msgHdr.flags & window.Components.interfaces.nsMsgMessageFlags.Replied) {
msgHdr.folder.msgDatabase.markHdrReplied(msgHdr, false, null);
} else {
msgHdr.folder.msgDatabase.markHdrReplied(msgHdr, true, null);
}
msgHdr.folder.msgDatabase = null;
})();
morat wrote: ↑November 4th, 2023, 3:00 pm@pacocasc
Are you using tbkey or tbkeys-lite?
You cannot run arbitrary javascript with tbkeys-lite.
You can use the cmd shorthand and func shorthand with tbkeys and tbkeys-lite.
Use the cmd shorthand for calling a command using the goDoCommand method.
For example, "cmd:cmd_nextMsg" is the same as "window.goDoCommand('cmd_nextMsg');".
Use the func shorthand for calling a function on the window object without a parameter.
For example, "func:MsgNewMessage" is the same as "window.MsgNewMessage();".
There is a tbkeys.xpi link on the GitHub releases page.
Troubleshooting: viewtopic.php?p=14872763#p14872763
-
- Posts: 6188
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
Are you saying that nothing works? I can get various commands working with my setup.pacocasc wrote:And the other commands don't seem to work either.
tbkeys 2.2.4
Thunderbird 115.4.1
Windows 10 Pro 21H2 32-bit
Main key bindings:
Code: Select all
{
"ctrl+1": "window.alert('example');",
"ctrl+2": "window.alert(window.gTabmail.currentAboutMessage.gMessage.mime2DecodedSubject);",
"ctrl+3": "(function () { var msgHdr = window.gTabmail.currentAboutMessage.gMessage; if (msgHdr.flags & window.Components.interfaces.nsMsgMessageFlags.Read) { window.alert('message is read'); } else { window.alert('message is unread'); }})();"
}
Code: Select all
(function () {
var msgHdr = window.gTabmail.currentAboutMessage.gMessage;
msgHdr.folder.msgDatabase.markHdrReplied(msgHdr, true, null);
msgHdr.folder.msgDatabase = null;
})();
http://searchfox.org/comm-esr115/source ... ly-col.svg
http://searchfox.org/comm-esr115/search ... -reply-col
Try asking the tbkeys developer for support.
-
- Posts: 10
- Joined: November 19th, 2020, 9:38 am
Re: keyconfig 20110522
Thanks.
tbkeys 2.2.4
Thunderbird 115.4.1
Windows 10 Home 22H2
From what you send me, only CTRL+1 works OK
The other two (CTRL2 y CTRL 3) do nothing. And the mark as read function doesn't work either. Yes, what it did before was show the purple reply icon in the subject column and Reply in the status column. Now it doesn't do any of the two things.
I give up for the moment. Thank you so much for your patience
tbkeys 2.2.4
Thunderbird 115.4.1
Windows 10 Home 22H2
From what you send me, only CTRL+1 works OK
Code: Select all
"ctrl+1": "window.alert('example');"
I give up for the moment. Thank you so much for your patience
morat wrote: ↑November 5th, 2023, 1:52 pmAre you saying that nothing works? I can get various commands working with my setup.pacocasc wrote:And the other commands don't seem to work either.
tbkeys 2.2.4
Thunderbird 115.4.1
Windows 10 Pro 21H2 32-bit
Main key bindings:
I can get the following command working with an unreplied message using the error console. (working means purple reply icon shows in subject column)Code: Select all
{ "ctrl+1": "window.alert('example');", "ctrl+2": "window.alert(window.gTabmail.currentAboutMessage.gMessage.mime2DecodedSubject);", "ctrl+3": "(function () { var msgHdr = window.gTabmail.currentAboutMessage.gMessage; if (msgHdr.flags & window.Components.interfaces.nsMsgMessageFlags.Read) { window.alert('message is read'); } else { window.alert('message is unread'); }})();" }
Replied indicator iconCode: Select all
(function () { var msgHdr = window.gTabmail.currentAboutMessage.gMessage; msgHdr.folder.msgDatabase.markHdrReplied(msgHdr, true, null); msgHdr.folder.msgDatabase = null; })();
http://searchfox.org/comm-esr115/source ... ly-col.svg
http://searchfox.org/comm-esr115/search ... -reply-col
Try asking the tbkeys developer for support.
Last edited by pacocasc on November 5th, 2023, 2:57 pm, edited 1 time in total.
-
- Posts: 10
- Joined: November 19th, 2020, 9:38 am
Re: keyconfig 20110522
Surprise:
The function you gave me in CTRL+2 has worked for me and also the function of marking a message as answered.
But they only work with an open message. They don't work, like the function worked for me before, being in the inbox with any message selected.
At least I know that by opening the message I can mark it. It's not as practical as before, but it works.
Even the function previous works with an open message. Before giving up, it occurred to me to try the read-unread alert message with the message open and when I saw that it worked, I tried the others as well.
The function you gave me in CTRL+2 has worked for me and also the function of marking a message as answered.
But they only work with an open message. They don't work, like the function worked for me before, being in the inbox with any message selected.
At least I know that by opening the message I can mark it. It's not as practical as before, but it works.
Even the function previous works with an open message. Before giving up, it occurred to me to try the read-unread alert message with the message open and when I saw that it worked, I tried the others as well.
Code: Select all
(function () {
var msgHdr = window.gTabmail.currentAboutMessage.gMessage;
if (msgHdr.flags & window.Components.interfaces.nsMsgMessageFlags.Replied) {
msgHdr.folder.msgDatabase.markHdrReplied(msgHdr, false, null);
} else {
msgHdr.folder.msgDatabase.markHdrReplied(msgHdr, true, null);
}
msgHdr.folder.msgDatabase = null;
})();
-
- Posts: 6188
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@pacocasc
Try these:
Those code snippets should work with the message pane disabled.
i.e. Menu Bar > View > Layout > [uncheck] Message Pane F8
Similar thread
http://thunderbird.topicbox.com/groups/ ... 51886b57b1
Try these:
Code: Select all
window.alert(window.gTabmail.currentAbout3Pane.gDBView.hdrForFirstSelectedMessage.mime2DecodedSubject);
Code: Select all
(function () {
var msgHdr = window.gTabmail.currentAbout3Pane.gDBView.hdrForFirstSelectedMessage;
if (msgHdr.flags & window.Components.interfaces.nsMsgMessageFlags.Replied) {
msgHdr.folder.msgDatabase.markHdrReplied(msgHdr, false, null);
} else {
msgHdr.folder.msgDatabase.markHdrReplied(msgHdr, true, null);
}
msgHdr.folder.msgDatabase = null;
})();
i.e. Menu Bar > View > Layout > [uncheck] Message Pane F8
Similar thread
http://thunderbird.topicbox.com/groups/ ... 51886b57b1
-
- Posts: 10
- Joined: November 19th, 2020, 9:38 am
Re: keyconfig 20110522
Now it works perfectly (with the message pane disabled) like the function I had these past three years.
Thank you very much for your help and your patience.
Thank you very much for your help and your patience.
morat wrote: ↑November 5th, 2023, 6:32 pm@pacocasc
Try these:
Code: Select all
window.alert(window.gTabmail.currentAbout3Pane.gDBView.hdrForFirstSelectedMessage.mime2DecodedSubject);
Those code snippets should work with the message pane disabled.Code: Select all
(function () { var msgHdr = window.gTabmail.currentAbout3Pane.gDBView.hdrForFirstSelectedMessage; if (msgHdr.flags & window.Components.interfaces.nsMsgMessageFlags.Replied) { msgHdr.folder.msgDatabase.markHdrReplied(msgHdr, false, null); } else { msgHdr.folder.msgDatabase.markHdrReplied(msgHdr, true, null); } msgHdr.folder.msgDatabase = null; })();
i.e. Menu Bar > View > Layout > [uncheck] Message Pane F8
Similar thread
http://thunderbird.topicbox.com/groups/ ... 51886b57b1
-
- Posts: 3
- Joined: September 12th, 2023, 9:50 am
Re: keyconfig 20110522
Hi all!
My setup:
- tbkeys 2.2.4
- Thunderbird 115.4.3
- Windows 10 Pro 22H2
I recently started using Thunderbird as a news feed reader. I want to create a shortcut to copy to the clipboard the values of the "Website" header of all currently selected messages.

I don't know where to start. Some advice? Thanks.
My setup:
- tbkeys 2.2.4
- Thunderbird 115.4.3
- Windows 10 Pro 22H2
I recently started using Thunderbird as a news feed reader. I want to create a shortcut to copy to the clipboard the values of the "Website" header of all currently selected messages.

I don't know where to start. Some advice? Thanks.
-
- Posts: 6188
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@Cris486
Here is how to copy the selected message subject to the clipboard.
Here is how to copy the inner text of the body element to the clipboard.
I don't know what you mean by website header. Is the website header the same as the website title?
i.e. window.content.document.title
Document title property
http://developer.mozilla.org/docs/Web/A ... ment/title
Here is how to copy the selected message subject to the clipboard.
Code: Select all
(function () {
var msgHdr = window.gTabmail.currentAbout3Pane.gDBView.hdrForFirstSelectedMessage;
if (msgHdr && msgHdr.mime2DecodedSubject) {
window.Components.classes['@mozilla.org/widget/clipboardhelper;1'].
getService(window.Components.interfaces.nsIClipboardHelper).
copyString(msgHdr.mime2DecodedSubject);
window.Services.prompt.alert(window, 'tbkeys', 'Copied to clipboard.');
}
})();
Code: Select all
(function () {
var msgHdrs = window.gTabmail.currentAbout3Pane.gDBView.getSelectedMsgHdrs();
var out = [];
for (var i = 0; i < msgHdrs.length; i++) {
if (msgHdrs[i] && msgHdrs[i].mime2DecodedSubject) {
out.push(msgHdrs[i].mime2DecodedSubject);
}
}
if (out.length) {
window.Components.classes['@mozilla.org/widget/clipboardhelper;1'].
getService(window.Components.interfaces.nsIClipboardHelper).
copyString(out.join('\r\n'));
window.Services.prompt.alert(window, 'tbkeys', 'Copied to clipboard.');
}
})();
Code: Select all
(function () {
var body = window.content && window.content.document.body;
if (body && body.innerText) {
window.Components.classes['@mozilla.org/widget/clipboardhelper;1'].
getService(window.Components.interfaces.nsIClipboardHelper).
copyString(body.innerText);
window.Services.prompt.alert(window, 'tbkeys', 'Copied to clipboard.');
}
})();
Code: Select all
(function () {
var body = window.gTabmail.currentAboutMessage &&
window.gTabmail.currentAboutMessage.getMessagePaneBrowser().contentWindow &&
window.gTabmail.currentAboutMessage.getMessagePaneBrowser().contentWindow.document.body;
if (body && body.innerText) {
window.Components.classes['@mozilla.org/widget/clipboardhelper;1'].
getService(window.Components.interfaces.nsIClipboardHelper).
copyString(body.innerText);
window.Services.prompt.alert(window, 'tbkeys', 'Copied to clipboard.');
}
})();
i.e. window.content.document.title
Document title property
http://developer.mozilla.org/docs/Web/A ... ment/title
-
- Posts: 3
- Joined: September 12th, 2023, 9:50 am
Re: keyconfig 20110522
First of all, thanks for the help.
I was referring to the text highlighted in green in the image I posted.
I found that the code below works.
Code: Select all
(function () {
var msgHdr = window.gTabmail.currentAbout3Pane.gDBView.hdrForFirstSelectedMessage;
window.alert(msgHdr.getStringProperty('content-base'));
})();
-
- Posts: 6188
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@Cris486
Try this:
The code snippet works for me with Planet Mozilla.
Planet Mozilla RSS Feed
https://planet.mozilla.org/rss20.xml
Online Multiline to Single Line Converter
https://tools.knowledgewalls.com/online ... -converter
Try this:
Code: Select all
(function () {
var msgHdrs = window.gTabmail.currentAbout3Pane.gDBView.getSelectedMsgHdrs();
var out = [];
for (var i = 0; i < msgHdrs.length; i++) {
if (msgHdrs[i] && msgHdrs[i].getStringProperty('content-base')) {
out.push(msgHdrs[i].getStringProperty('content-base'));
}
}
if (out.length) {
var imageUrl = 'chrome://mozapps/skin/extensions/extensionGeneric.svg';
window.Components.classes['@mozilla.org/widget/clipboardhelper;1'].
getService(window.Components.interfaces.nsIClipboardHelper).
copyString(out.join('\r\n'));
window.Components.classes['@mozilla.org/alerts-service;1'].
getService(window.Components.interfaces.nsIAlertsService).
showAlertNotification(imageUrl, 'tbkeys', `Copied to clipboard.\n\nWebsites: ${out.length}`);
}
})();
Planet Mozilla RSS Feed
https://planet.mozilla.org/rss20.xml
Online Multiline to Single Line Converter
https://tools.knowledgewalls.com/online ... -converter
-
- Posts: 3
- Joined: September 12th, 2023, 9:50 am
Re: keyconfig 20110522
It works! Thank you!morat wrote: ↑November 21st, 2023, 9:47 am@Cris486
Try this:
Code: Select all
(function () { var msgHdrs = window.gTabmail.currentAbout3Pane.gDBView.getSelectedMsgHdrs(); var out = []; for (var i = 0; i < msgHdrs.length; i++) { if (msgHdrs[i] && msgHdrs[i].getStringProperty('content-base')) { out.push(msgHdrs[i].getStringProperty('content-base')); } } if (out.length) { var imageUrl = 'chrome://mozapps/skin/extensions/extensionGeneric.svg'; window.Components.classes['@mozilla.org/widget/clipboardhelper;1']. getService(window.Components.interfaces.nsIClipboardHelper). copyString(out.join('\r\n')); window.Components.classes['@mozilla.org/alerts-service;1']. getService(window.Components.interfaces.nsIAlertsService). showAlertNotification(imageUrl, 'tbkeys', `Copied to clipboard.\n\nWebsites: ${out.length}`); } })();
-
- Posts: 6188
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@Cris486
You're welcome.
Here is how to change the transparent background in the alert notification.
Reference
http://searchfox.org/mozilla-esr115/sou ... lert.xhtml
http://searchfox.org/mozilla-esr115/sou ... /alert.css
You're welcome.
Here is how to change the transparent background in the alert notification.
Code: Select all
/* Thunderbird userChrome.css */
@-moz-document url-prefix("chrome://global/content/alerts/alert.xhtml") {
#alertNotification {
background: -moz-Dialog !important;
}
}
http://searchfox.org/mozilla-esr115/sou ... lert.xhtml
http://searchfox.org/mozilla-esr115/sou ... /alert.css