[Users] Flagging non-default accounts during compose?
berndth at gmx.de
Sat Aug 3 11:50:38 CEST 2013
On Mo, 29.07.2013 08:28, Ricardo Mones wrote:
> Would it be possible to add some submenu to compose windows' Edit
>menu (for example), whose options were able to modify compose text
>and/or subject on user invocation?
Any script that you put into .claws-mail/python-scripts/compose will
end up as a menu entry in the compose window under Tools / Python
You also get access to the compose window's GtkUiManager object, so
alternatively, you can use that from
.claws-mail/python-scripts/auto/compose_any to insert menu items
at other places (see  for a few examples of doing this in the main
window - I didn't try it, but compose window should work analogous).
Another alternative would be to put it into the toolbar, which is
possible via the normal Claws Mail dialog. Shortcut assignment
is also possible.
As for subject or body modifications: For the subject, you have set()
and get() functions, an example can be seen in . For the body, you
have access to the GtkTextView widget, which you can modify using the
normal PyGtk bindings. An example can be seen in .
Personally, I find the example in  quite interesting, because you
can not only do text replacement, but execute any Python code, and
e.g. attach automatically some standard path or whatever. I used to
use something similar in TheBat! many moons ago, which had a macro language with
fixed commands for that - so, with Python being a general purpose
language, it's even more flexible. IIRC the shortcut that I assigned
to invoking that script, CTRL-Space, also originates from the TheBat! default.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: not available
More information about the Users