[MacEd] Newbe and macro for thunderbird

Andrea M. acme at email.it
Tue Dec 16 09:41:04 EST 2003


Biju G C ha scritto:

>  --- "Andrea M." <acme at email.it> wrote: 

[snip]

> following is "setmsgbody" macro which can change body
> of the message in editor window of thunderbird
> 
> //===== setmsgbody start =====
> 
> var contentFrame = document.getElementById("content-frame");  
> var contentDoc = contentFrame.contentWindow._content.document;
> contentDoc.body.innerHTML=prompt("Please enter body of mail");
> 
> //===== setmsgbody ends =====
> 
> you may be able to modify this to achieve what you want.
> For more research check \content\editor\editor.xul in mail.jar

Hi Biju, thanks a lot for your *very* useful example, starting from this 
I wrote this macro:

//===== Reject Charter start =====

var contentFrame = document.getElementById("content-frame");
var contentDoc = contentFrame.contentWindow._content.document;
var selection= GetSelectionAsText();
var len=selection.length;
var start= len - 16
var subsel=selection.substring(start,len);
contentDoc.body.innerHTML="Command: reject" + " " + subsel + " " + "charter"

//===== Reject Charter end =====

 >
 ># whitelist: Unknown: someone at somewere.net
 >Command: approve 1071193880.23639

Normally the first line is empty, what I need is the "magic" number at 
the end on the third line, so I have only to select from first to third 
line (or only the third) and select the macro I want (I wrote all macros 
I need) and I obtain exactly what I need.

> following is the list of variables/property/functions 
> (having word get/set) I found in editor window 
> You may get a better method in that.
> (So if you find it pl. post it)

Last night I checked many of this, next night probably I'll finish to do :-)

[snip]

Thanks again.
Ciao, Andrea


More information about the MacroEditor mailing list