[MacEd] Newbe and macro for thunderbird

Biju G C bijumaillist at yahoo.com
Tue Dec 16 23:56:52 EST 2003


 --- "Andrea M." <acme at email.it> wrote: 
> 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 =====

I modified it. to check word Command approve, reject etc.
to find the line 

and here it is
 
//=========== Approve Macro Begin ==========
var contentFrame = document.getElementById("content-frame");
var contentDoc = contentFrame.contentWindow._content.document;
var a = contentDoc.body.textContent ;
a=a.split('\n');
var i;
for (i = 0 ; i < a.length;i++)
{
 if(a[i].search(/Command.*approve.*\d*/i) != -1)
 {
  contentDoc.body.innerHTML=a[i]
  break;
 }
 if (i > 10) break;
}

//=========== Approve Macro End ==========




//=========== Reject Macro Begin ==========
var contentFrame = document.getElementById("content-frame");
var contentDoc = contentFrame.contentWindow._content.document;
var a = contentDoc.body.textContent ;
a=a.split('\n');
var i;
for (i = 0 ; i < a.length;i++)
{
 if(a[i].search(/Command.*reject.*\d*/i) != -1)
 {
  contentDoc.body.innerHTML=a[i]
  break;
 }
 if (i > 10) break;
}


//=========== Reject Macro End ==========




________________________________________________________________________
BT Yahoo! Broadband - Save £80 when you order online today. Hurry! Offer ends 21st December 2003. The way the internet was meant to be. http://uk.rd.yahoo.com/evt=21064/*http://btyahoo.yahoo.co.uk


More information about the MacroEditor mailing list