[MacEd] Newbe and macro for thunderbird

Biju G C bijumaillist at yahoo.com
Mon Dec 15 18:00:13 EST 2003


 --- "Andrea M." <acme at email.it> wrote: 
> Hi, I'm new to javascript, I'm reading a lot of documents in order to
> try to write a macro for thunderbird. I need to modify a "reply
> document" to help me to moderate an italian newsgroup. I normally have
> an email message like this:
> 
> ># whitelist: Unknown: someone at somewere.net
> >Command: approve 1071193880.23639
> >Command: reject 1071193880.23639 charter
> >
> >followed by the message
> >bla bla bla
> 

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

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)


pl. check any of them is useful for you by doing,
(to get the definition )
from menu Tools/Macro/execute...
then do something like
  alert(GetBodyElement); 
or by
  prompt('', GetBodyElement); 

as explained in
http://mozdev.org/pipermail/macroeditor/2003-November/000004.html

then try using it


GetPrintSettings, getInvalidAccounts, GetSelectedFolderURI
GetMsgFolderFromUri, GetResourceFromUri, GetBackgroundElementWithColor
GetParentTable, GetParentTableCell, GetObjectForProperties
GetListStateString, GetAlignmentString, GetBodyElement
EditorGetNodeFromOffsets, getColorAndSetColorWell, GetNumberOfContiguousSelectedRows
GetNumberOfContiguousSelectedColumns, GetSelectionContainer, gMsgAddressingWidgetTreeElement
GetSelectedMessages, GetArgs, GetCharsetUIString
getCurrentIdentity, getIdentityForKey, GetLastAttachDirectory
SetMsgAddressingWidgetTreeElementFocus, GetMsgAddressingWidgetTreeElement, GetMsgIdentityElement
GetMsgSubjectElement, GetMsgAttachmentElement, GetMsgHeadersToolbarElement
awGetMaxRecipients, awGetNumberOfCols, awGetSelectItemIndex
awGetPopupElement, awGetInputElement, awGetElementByCol
awGetListItem, awGetRowByInputElement, awGetNumberOfRecipients
DragOverAddressingWidget, DropOnAddressingWidget, awGetNextDummyRow
getBrowserURL, getTopWin, GetString
GetSelectionAsText, GetCurrentEditor, GetCurrentTableEditor
GetCurrentEditorElement, GetCurrentEditingSession, GetCurrentCommandManager
GetCurrentEditorType, GetDocumentTitle, GetAtomService
EditorGetTextProperty, GetIOService, GetFileProtocolHandler
GetPrefsService, GetPrefs, GetStringPref
GetBoolPref, GetUnicharPref, GetDefaultBrowserColors
GetDocumentBaseUrl, GetDocumentUrl, GetScheme
GetHost, GetUsername, GetFilename
GetOS, GetHTMLOrCSSStyleValue, GetComposerCommandTable
GetExtensionBasedOnMimeType, GetSuggestedFileName, GetOutputFlags
GetWrapColumn, GetPromptService, GetDocUrlFromPublishData
getSelection, getAttention, getComputedStyle


gPrintSettings, setPrinterDefaultsForSelectedPrinter, GetPrintSettings
goPageSetup, NSPrintSetup, MsgSetFolderCharset
SetFocusOnStartup, EditorResetFontAndColorAttributes, SafeSetAttribute
EditorSetDocumentCharacterSet, updateCharsetPopupMenu, EditorSetFontSize
SetSmiley, SetEditMode, SetDisplayMode
EditorSetDefaultPrefsAndDoctype, EditorGetNodeFromOffsets, EditorSetSelectionFromOffsets
getColorAndSetColorWell, ResetStructToolbar, gSetupLdapAutocomplete
gCurrentMailSendCharset, gSendDefaultCharset, gCharsetTitle
gCharsetConvertManager, SetupCommandUpdateHandlers, AddDirectorySettingsObserver
RemoveDirectorySettingsObserver, setupLdapAutocompleteSession, SetDocumentCharacterSet
UpdateMailEditCharset, InitCharsetMenuCheckMark, GetCharsetUIString
SetComposeWindowTitle, SetContentAndBodyAsUnmodified, SetLastAttachDirectory
setDomainName, setupAutocomplete, SetMsgAddressingWidgetTreeElementFocus
SetMsgIdentityElementFocus, SetMsgSubjectElementFocus, SetMsgAttachmentElementFocus
SetMsgBodyFrameFocus, FlavourSet, TransferDataSet
awSetInputAndPopupValue, _awSetInputAndPopup, awSetInputAndPopup
awSetInputAndPopupFromArray, awResetAllRows, awSetFocus
_awSetFocus, _awSetAutoComplete, awSetAutoComplete
SetDefaultCharacterSet, SetForcedDetector, SetForcedCharset
gPrevCharset, UpdateCurrentCharset, UpdateCurrentMailCharset
UpdateCharsetDetector, gCharsetMenu, gLastBrowserCharset
charsetLoadListener, composercharsetLoadListener, SetForcedEditorCharset
gLastMailCharset, mailCharsetLoadListener, goSetCommandEnabled
goSetMenuValue, goSetAccessKey, setTooltipText
setOfflineUI, setupBundles, showNeedSetupInfo
setSecuritySettings, setNextCommand, setNoSignatureUI
setSignatureUI, setNoEncryptionUI, setEncryptionUI
SetDocumentTitle, EditorSetTextProperty, SetElementEnabledById
SetElementEnabled, SetUnicharPref, SetFilePickerDirectory
SetupHTMLEditorCommands, SetupTextEditorCommands, SetupComposerWindowCommands
nsSaveAsCharsetCommand, PromptAndSetTitleIfNone, SetDocumentURI
SetSaveAndPublishUI, SetDocumentEditable, nsPublishSettingsCommand
nsPrintSetupCommand, nsFieldSetCommand, nsSetSmiley
setTimeout, setInterval, setResizable
pageXOffset, pageYOffset, setCursor





________________________________________________________________________
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