[MacEd] "check all folder for new messages" macro

Biju G C bijumaillist at yahoo.com
Sat Nov 1 18:59:10 EST 2003


I got the mail from Mario Ivankovits. 
I tried to reach him and found unsucessful

I tried it in Moz & Tb but could not see any effect.

So i thought I will post it here

 --- Mario Ivankovits <mario (at) ops.co.at> wrote: 
Hello !

Sorry, i havent managed how to add this directly to 
"http://macroeditor.mozdev.org/macroeditorex.html".

This macro sets the property "check folder for new message" on all 
folders (recusiv)

If you would like, you could add this to the macro exchange.

Thank you,
Mario

---cut---
const MSG_FOLDER_FLAG_CHECK_NEW = 0x20000000

var accountManager = 
Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
 
 
var allServers = accountManager.allServers;
var numServers = allServers.Count();

for (var i = 0; i < numServers; i++){
   var serversMsgFolders = 
allServers.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgIncomingServer).rootMsgFolder;
  processFolder(serversMsgFolders);
}

alert("done");

function processFolder(folder){

  folder.setFlag(MSG_FOLDER_FLAG_CHECK_NEW);

  var subFolderEnumerator = folder.GetSubFolders();
  var done = false;
  while (!done) {
     try {
        var element = subFolderEnumerator.currentItem();
       var msgFolder = 
 element.QueryInterface(Components.interfaces.nsIMsgFolder);
       processFolder(msgFolder);
 
       subFolderEnumerator.next();
    } catch (ex)  {
       done = true;
    }
  }
}

---cut---


________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk


More information about the MacroEditor mailing list