Comments (11)
Hello !
I don't understand the post above, but I'm interested with the mean to define a shortcut to set the font color of the selected text to red (for instance…). In the compose window, of course !
Is it possible ? How ? The command fontColor has to be used with a parameter…
Thanks,
Mist
from tbkeys.
You can create a keyboard shortcut that executes a custom command with the tbkeys addon.
You are using obsolete code from Thunderbird 2.0.
More info...
http://forums.mozillazine.org/viewtopic.php?f=39&t=2925785
Try this:
window.EditorSetTextProperty('font', 'color', '#ff0000');
window.goUpdateCommandState('cmd_fontColor');
Tips...
http://forums.mozillazine.org/viewtopic.php?p=14872763#p14872763
from tbkeys.
Hi morat,
Thanks for your answer. I had searched on Geckozone but not on mozillazine, I will learn the lesson !
But I don't manage to find the correct syntax in tbkeys settings :-(
Could you help me again ?
After reading mozillazine I've tried this (in compose key bindings) :
"ctrl+r": "func: (function () {
window.EditorSetTextProperty('font', 'color', '#ff0000');
window.goUpdateCommandState('cmd_fontColor');}) ();"
And some variants, without success…
Mist
from tbkeys.
Did you remember to remove the newline characters in the code snippet so the input is a valid JSON string?
Did you remember to remove the trailing comma after the last key so the input is a valid JSON string?
Try the following compose key bindings in settings using the tbkey addon.
{
"ctrl+1": "window.EditorSetTextProperty('font', 'color', '#ff0000'); window.goUpdateCommandState('cmd_fontColor');",
"ctrl+2": "window.EditorSetTextProperty('font', 'color', '#00ff00'); window.goUpdateCommandState('cmd_fontColor');",
"ctrl+3": "window.EditorSetTextProperty('font', 'color', '#ff00ff'); window.goUpdateCommandState('cmd_fontColor');"
}
JSON Validator...
from tbkeys.
Many thanks morat,
So simple solution, works fine !
I had nevertheless applied myself, but I wondered if "func" or "function" were necessary, ultimately neither !!
Mist
from tbkeys.
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();".
Use (function(){...})(); when creating a variable with the var statement.
e.g.
(function () {
var color = '#ff0000';
window.EditorSetTextProperty('font', 'color', color);
window.goUpdateCommandState('cmd_fontColor');
})();
You're welcome.
from tbkeys.
from tbkeys.
Try the following code snippets using the tbkeys addon.
window.gFolderTreeView.mode = 'all';
window.gFolderTreeView.mode = 'unread';
window.gFolderTreeView.mode = 'favorite';
window.gFolderTreeView.mode = 'smart';
window.gFolderTreeView.mode = 'unread_compact';
window.gFolderTreeView.mode = 'favorite_compact';
window.gFolderTreeView.mode = 'recent_compact';
You cannot execute arbitrary javascript using the tbkeys-lite addon.
from tbkeys.
from tbkeys.
I tried the following main key bindings in settings using the tbkey addon. It works for me.
{
"shift+a": "window.gFolderTreeView.mode = 'all';",
"shift+s": "window.gFolderTreeView.mode = 'favorite';"
}
Try running the code snippets using the error console.
Instructions:
- open error console i.e. tools > developer tools > error console
- copy and paste code snippet into error console
- press enter to run
Error Console command line
http://developer.mozilla.org/docs/Tools/Browser_Console#Browser_Console_command_line
There may be a conflict with another addon. Try disabling all addons except the tbkey addon, then restart and test again.
from tbkeys.
It is easy to misunderstand, and interpret the following from documentation to that you can't use parameters in the keybindings:
Simple function calls: These follow the format func:<func_name> where <func_name> is a function defined on the Thunderbird window object. That function is called without any arguments.
However, you can do that, but with a longer syntax.
The following will map the single character "o" to move the currently selected email to a specific folder:
"o": "window.MsgMoveMessage(window.MailUtils.getExistingFolder('imap://[email protected]/folder/path'))",
I took me a while to figure out the syntax, especially since the official documentation of the MsgMoveMessage and MailUtils are not up to date, and describes outdated syntax and function names.
from tbkeys.
Related Issues (20)
- Disable Ctrl-Enter? HOT 1
- Adding ToggleMessageTag HOT 2
- Open html file in browser? HOT 4
- Get all messanges from all boxes? HOT 1
- Updated key bindings not reflected in TB menus HOT 2
- [question] how can I collapse / expand all mail accounts? HOT 1
- How to trigger a menu item? HOT 4
- Command to preformat text? HOT 3
- Question: (How) can I simulate a modfier + key with a tbkeys single key shortcut? HOT 9
- Prevent thread expansion with j/k navigation keys HOT 3
- JS: Set caret position in "Caret browsing" mode HOT 2
- Shortcuts being triggered in the new Search field HOT 2
- Context for eval HOT 1
- [QUESTION] What is the appropriate command to toggle starring an email? HOT 1
- [QUESTION] Is there a command for showing remote content? HOT 13
- Add a shortcut to switch the editor type when creating a new message? HOT 2
- Uplift to be compatible with TB 113? HOT 5
- Compatibility issue with 115 HOT 9
- [Question] End-of-line in composition HOT 2
- Can one do single key to multiple actions / commands? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tbkeys.