Hello There, Guest! (LoginRegister)

Skinning Documentation

Introduction to Scripting
Getting Started
What's a Messenger Plus! Script?
Scripting Environment
Your First Script
Working with Scripts
From Plugins to Scripts
Packaging your Script
Windows for your Script
Testing your Windows
Objects Reference
Debug Object
Description
Functions
Trace
ClearDebuggingWindow
Properties
DebuggingWindowVisible
Messenger Object
Description
Functions
AutoSignin
Signout
OpenChat
Properties
Version
VersionBuild
ContactListWndHandle
CurrentChats
ReceiveFileDir
MyContacts
MyEmail
MyUserId
MyStatus
MyName
MyPersonalMessage
MyCurrentMedia
MyDisplayPicture
CustomEmoticons
MsgPlus Object
Description
Functions
DisplayToast
DisplayToastContact
CreateWnd
CreateChildWnd
AddTimer
CancelTimer
PlaySound
LockMessenger
LogEvent
RemoveFormatCodes
DownloadFile
UploadFileFTP
LoadScriptFile
ExtractFromZIP
Properties
Version
VersionBuild
ScriptRegPath
ScriptFilesPath
MessengerIsLocked
UILangCode
ChatWnds Object
Description
Functions
Iterator
Properties
Count
ChatWnd Object
Description
Functions
SendMessage
SendFile
AddContact
DisplayInfoMessage
ResetInfoMessage
EditText_GetCurSelStart
EditText_GetCurSelEnd
EditText_SetCurSel
EditText_ReplaceSel
HistoryText_GetCurSelStart
HistoryText_GetCurSelEnd
HistoryText_GetTextRange
Properties
Handle
Contacts
EditText
EditChangeAllowed
ChatLogEnabled
OverrideFmtEnabled
IsMobileChat
Contacts Object
Description
Functions
Iterator
GetContact
Properties
Count
Contact Object
Description
Properties
Email
Network
Status
Name
PersonalMessage
CurrentMedia
Blocked
DisplayPicture
IsFloating
Emoticons Object
Description
Functions
Iterator
GetEmoticon
Properties
Count
Emoticon Object
Description
Properties
Shortcut
Name
PictureFile
PlusWnd Object
Description
Functions
Close
RegisterMessageNotification
GetControlHandle
SendControlMessage
GetControlText
SetControlText
GetElementPos
Button and Checkmark Controls
Button_IsChecked
Button_SetCheckState
Button_SetElementText
ComboBox Controls
Combo_AddItem
Combo_RemoveItem
Combo_GetCurSel
Combo_SetCurSel
Combo_GetItemData
Combo_GetCount
ListBox Controls
LstBox_AddItem
LstBox_GetItemText
LstBox_RemoveItem
LstBox_GetCurSel
LstBox_SetCurSel
LstBox_GetItemData
LstBox_GetCount
ListView Controls
LstView_AddItem
LstView_SetItemText
LstView_GetItemText
LstView_RemoveItem
LstView_GetItemData
LstView_GetCount
LstView_GetSelectedState
LstView_SetSelectedState
LstView_GetCheckedState
LstView_SetCheckedState
LstView_SetItemIcon
Edit and RichEdit Controls
EditBox_SetCurSel
EditBox_ReplaceSel
EditBox_GetCurSelStart
EditBox_GetCurSelEnd
RichEdit_GetTextRange
RichEdit_SetCharFormat
Browser Controls
Browser_GetInterface
Image Elements
ImageElmt_SetImageFile
Properties
Handle
Visible
WindowId
Interop Object
Description
Functions
Call
Call2
FreeDll
GetLastError
Allocate
GetCallbackPtr
DataBloc Object
Description
Functions
GetAt
SetAt
ReadString
WriteString
ReadBSTR
WriteBSTR
ReadWORD
WriteWORD
ReadDWORD
WriteDWORD
ReadInterfacePtr
WriteInterfacePtr
Properties
Size
DataPtr
Events Reference
Messenger Events
OnEvent_Signin
OnEvent_SigninReady
OnEvent_Signout
OnEvent_MyStatusChange
OnEvent_MyNameChange
OnEvent_MyPsmChange
OnEvent_MyMediaChange
OnEvent_ContactSignin
OnEvent_ContactSignout
OnEvent_ContactStatusChange
OnEvent_ContactNameChange
OnEvent_ContactPsmChange
OnEvent_ContactMediaChange
OnEvent_ContactBlocked
OnEvent_ContactUnblocked
OnEvent_ContactListWndCreated
OnEvent_ContactListWndDestroyed
OnEvent_ChatWndCreated
OnEvent_ChatWndDestroyed
OnEvent_ChatWndContactAdded
OnEvent_ChatWndContactRemoved
OnEvent_ChatWndReceiveMessage
OnEvent_ChatWndSendMessage
OnEvent_ChatWndEditKeydown
Messenger Plus! Events
OnEvent_Initialize
OnEvent_Uninitialize
OnEvent_MessengerLocked
OnEvent_MessengerUnlocked
OnEvent_Timer
OnEvent_MenuClicked
OnEvent_EnterPersonalizedStatus
OnEvent_LeavePersonalizedStatus
OnEvent_DownloadFileComplete
OnEvent_UploadFileComplete
OnGetScriptMenu
OnGetScriptCommands
Events Templates
ScriptsCommandTemplate
ToastCallbackTemplate
Interface Windows Events
OnWindowidEvent_Cancel
OnWindowidEvent_Destroyed
OnWindowidEvent_MessageNotification
OnWindowidEvent_CtrlClicked
OnWindowidEvent_ComboSelChanged
OnWindowidEvent_EditTextChanged
OnWindowidEvent_LstBoxSelChanged
OnWindowidEvent_LstBoxDblClicked
OnWindowidEvent_LstViewClicked
OnWindowidEvent_LstViewRClicked
OnWindowidEvent_LstViewDblClicked
OnWindowidEvent_LstViewSelStateChanged
XML Schemas Reference
ScriptInfo File
Information
Examples
Schema Documentation
Interface Windows
Information
Examples
Schema Documentation

Scripting Environment

Having a capable scripting system is not enough if what's surrounding it is not adapted to rapid development scenarios. That's why Messenger Plus! Live was designed with a special developer's mode. This option makes developing scripts an easier task while shielding end-users from boring technicalities at the same time. When debugging options are enabled, developers get access to a special debug window as well as special advantages designed to help them get what they want, how they want.

Your main point of entry in the scripting system is the Preferences panel (you'll need to be signed in to access it). From the Plus! menu of your contact list, select Preferences and click on Scripts in the left section (the Scripts section is available in the General tab). This window lists every script currently installed as well as their running state. Scripts that are not running are generally either disabled or contain syntax errors. End-users will generally stick to the "Import" button when they'll want to add a script to Messenger Plus!. The Import button loads a script pack and installs the script automatically based on the developer's configuration file. The Remove button deletes the whole directory of the script and places it in the Recycle Bin (just in case removing the script was a bad idea after all ;).

Before you create a new script, you'll want to check "Enable debugging options" and exit the Preferences window. If this is the first time you enable this mode, you'll automatically see the Script Debugging window (if not, the option to show/hide this window is accessible from the Plus! menu of your contact list). The Script Debugging window gives you access to every script currently running in Messenger. The "Debug" menu button links to a couple of functions including quick access to your script's source code. That being said, the main purpose of this window is definitively to show debugging information traced by scripts. You'll also see automatic traces for events executed in your script and error codes with the location in your code where the error occurred. When coding scripts in Messenger Plus!, this window will probably be one of your best friends :).

Enabling debugging options also has one more noticeable advantage. Messenger Plus! comes with its own script editor. This editor supports syntax coloring, outlining, basic IntelliSense and many other features designed to help you while you code. It is probably enough for script developers who want to code their scripts quickly without starting an external software. However, we understand that the built-in editor has its limitations and because so many great JScript editors already exist on the market (like Visual Studio), Messenger Plus! lets you use your favorite editor by monitoring changes done in your ".js" script files. When debugging option are enabled, if a script file is modified by an external application, the script is automatically reloaded to apply the changes. This means that every time you save your script, you instantly see the changes without having to perform any extra manipulation. Note however that in order to avoid any possible kind of confusion, this functionality is disabled while the script editor window is displayed. Also, remember that this feature is only intended to be used by developers, this means that you cannot rely on it for public use of your script (so don't code a feature that expects code file changes to be intercepted by Messenger Plus!).

There is also one more thing to remember about restarting your scripts: it is considered to be a good practice to close every window your script may be displaying, including message boxes, before the script is stopped. Because of the way script code is executed, if a script is stopped in its execution while it is displaying a modal window (a window that stops the execution of your script until it's closed), Messenger may completely crash. If you forget to close a window and crash Messenger as a result of stopping/restarting your script, don't worry about possible problems, there isn't any (no need to send an error report either).

If you're new to the Messenger Plus! Live scripting system, it is recommended that you stick with the built-in editor for a while. It will probably help you have a more complete understanding of the system and you'll see that the built-in editor is not that bad either ;). Now that you have enabled the debugging option, you're ready to create your first script!

See Also

What's a Messenger Plus! Script?, Your First Script.