gMsgFolderSelected

General discussion about Custom Buttons, including feature requests.

gMsgFolderSelected

Postby adtsu » Sat May 19, 2012 11:56 am

Hi, I installed Custom Buttons 0.0.5.6pre3 in Thunderbird 10.0.4, and tried to make a button with this code (inspired from http://custombuttons.mozdev.org/drupal/ ... 99?quote=1 ):
Code: Select all
var orig = gMsgFolderSelected.Value;
var ok = orig + "/ok";
MsgMoveMessage(ok);

But the button doesn't work, and I can see this in the error console:
Code: Select all
Error: gMsgFolderSelected is null

How can I fix it?
adtsu
 
Posts: 2
Joined: Sat May 19, 2012 11:42 am

Re: gMsgFolderSelected

Postby adtsu » Sat May 19, 2012 3:46 pm

I think I found the solution:
Code: Select all
var orig = gFolderDisplay.displayedFolder.Value;
var ok = orig + "/ok";
MsgMoveMessage(GetMsgFolderFromUri(ok));
adtsu
 
Posts: 2
Joined: Sat May 19, 2012 11:42 am

Re: gMsgFolderSelected

Postby morat » Sat May 19, 2012 4:34 pm

Try these:

Code: Select all
/*Code*/
alert(GetFirstSelectedMsgFolder().URI);

Code: Select all
/*Code*/
var targetUri = "mailbox://nobody@Local%20Folders/Trash";
var targetFolder = GetMsgFolderFromUri(targetUri);
MsgMoveMessage(targetFolder);

Code: Select all
/*Code*/
var targetUri = GetFirstSelectedMsgFolder().URI + "/Subfolder";
var targetFolder = GetMsgFolderFromUri(targetUri);
MsgMoveMessage(targetFolder);

Code: Select all
/*Code*/
var folder = GetFirstSelectedMsgFolder();
if (folder.hasSubFolders) {
  var enumerator = folder.subFolders;
  var targetFolder = enumerator.getNext();
  MsgMoveMessage(targetFolder);
}
morat
 
Posts: 951
Joined: Wed Dec 28, 2011 2:38 pm


Return to General Discussion

cron