I have the account name I want to create a folder under it.
I have the account name folder name I want to create a subfolder under it
How can i Create Folder and SubFolder in a java script
-
- Posts: 40
- Joined: September 29th, 2009, 1:57 pm
-
- Posts: 6437
- Joined: February 3rd, 2009, 6:29 pm
Re: How can i Create Folder and SubFolder in a java script
Try these:
Reference
http://dxr.mozilla.org/comm-esr60/searc ... _newFolder
Code: Select all
gFolderTreeController.newFolder();
Code: Select all
var folder = gFolderDisplay.displayedFolder;
var rootFolder = folder.rootFolder;
gFolderTreeController.newFolder(rootFolder);
http://dxr.mozilla.org/comm-esr60/searc ... _newFolder
-
- Posts: 40
- Joined: September 29th, 2009, 1:57 pm
Re: How can i Create Folder and SubFolder in a java script
Thank you.
you finally got me in the right direction
problem is it brings up a dialog box
i need it to create with out a dialog box
supply the root and the folder name to write
you finally got me in the right direction
problem is it brings up a dialog box
i need it to create with out a dialog box
supply the root and the folder name to write
-
- Posts: 6437
- Joined: February 3rd, 2009, 6:29 pm
Re: How can i Create Folder and SubFolder in a java script
nsIMsgFolder.createSubfolder
http://dxr.mozilla.org/comm-esr60/sourc ... Folder.idl
http://dxr.mozilla.org/comm-esr60/sourc ... Folder.idl
Code: Select all
var folder = gFolderDisplay.displayedFolder;
var rootFolder = folder.rootFolder;
rootFolder.createSubfolder("Example", msgWindow);
Code: Select all
var rootUri = "imap://username%40gmail.com@imap.googlemail.com";
var rootFolder = MailUtils.getFolderForURI(rootUri);
rootFolder.createSubfolder("Example", msgWindow);
-
- Posts: 40
- Joined: September 29th, 2009, 1:57 pm
Re: How can i Create Folder and SubFolder in a java script
ok it works
it create a example folder in every folder
it create a example folder in every folder
Code: Select all
var acctMgr = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
var accounts = acctMgr.accounts;
for (var i = 0; i < accounts.length; i++) {
var account = accounts.queryElementAt(i, Components.interfaces.nsIMsgAccount);
console.log(account.incomingServer.prettyName);
account.incomingServer.rootFolder.createSubfolder("Example", msgWindow);
}