This script is started as a short example which I posted in this thread, but it is now expanded and more configurable. It allows logging of next MM events: OnPlay, OnStop, OnPause, OnSeek, OnTrackEnd, OnPlaybackEnd, OnTrackSkipped, OnCompletePlaybackEnd, OnTrackProperties, OnTrackAdded, OnTrackDeleting, OnTrackConverted, OnBeforeTracksMove, OnStartUp and/or OnShutdown. Next data are stored in the log file: date/time, computer/user name, name of the event, track name. The location of the log file could be specified in the Options dialog box. The log file is saved in CSV format, so it could be imported e.g. in Excel. Events could be also displayed with the Event Viewer dockable panel.
What is new:
v2.4.1 - 2012-02-06
* Fixed: using of Event Viewer and Logger in other scripts.
v2.4 - 2012-02-04
* Added: view of events without writing to the log file: OnChangedSelection, OnTrackListFilling, OnTrackListFilled, OnNowPlayingSelectionChanged, OnNowPlayingModified, OnTrackListSelectionChanged and OnTrackListModified [MMx];
* Added: possibility for script developers to use Event Viewer and Logger for displaying/logging messages from their code (please read the Usage section).
v2.3 - 2011-06-22
* Added: OnTrackSkipped and OnCompletePlaybackEnd events [MM4];
* Fixed: skin styles path [MM4];
* Fixed: visible state of Event Viewer after restart when it is closed on the [x] button from the Titlebar.
v2.2.1 - 2009-06-27
* Fixed: View Log File option and display of events in Event Viewer with log files in UTF-8/Unicode format.
v2.2 - 2009-05-13
* Added: OnPlaybackEnd event;
* Improved: skin styles;
* Fixed: error with Maximal log file size.
v2.1 - 2009-03-04
* Added: possibility to open a new log file when the file size is greater then specified value;
* Added: option in the context menu to open a specified log file into the Event Viewer;
* Added: display of information about opened log file and events range;
* Added: song position for Pause and Seek events;
* Improved: Event Viewer's skin automatically updated after skin change in the Options dialog box (only for supported skins).
v2.0 - 2009-03-01
* Added: Event Viewer dockable panel;
* Added: possibility to toggle Event Viewer title bar from the context menu (MM 18.104.22.1689 or up);
* Added: option Maximal # of rows in Event Viewer;
* Added: option Load log file when open Event Viewer;
* Added: option to save log file as ANSI, UTF-8 or Unicode.
v1.1.2 - 2009-02-07
* Fixed: deleting of tracks when enabled logging of the OnTrackDeleting event.
v1.1.1 - 2009-02-06
* Fixed: error with OnBeforeTracksMove and OnTrackProperties events.
v1.1 - 2009-02-06
* Added: OnBeforeTracksMove and OnTrackProperties events;
* Fixed: log file name when the "Write a new log file every day" is turned on.
v1.0 - 2009-02-05
* First public version.
- For MediaMonkey 3.0 or higher - just double-click on the EventLogger.mmip file; if you are on Vista or Win7 make sure you have MM3 set to "Run as Administrator"; if you downloaded the installation package with IE7 and it changed its extension to a .zip, you should first change it back to a .mmip.
- For MediaMonkey 2.x - rename a .mmip extension to a .zip, extract the EventLogger.vbs and EventLoggerGUI.vbs files to the MediaMonkey's "Scripts\Auto" folder and restart MM program.
Choose View | Event Viewer to show/hide dockable panel. The add-on settings are in the Tools | Options dialog box within the Event Logger sheet (turning on/off of events works immediately after the confirmation only with MM 22.214.171.1245 or higher).
The script developers could use this add-on to display some text from their code by placing few additional lines of code on the appropriate places in the script. The scripters could use MsgBox or SDB.MessageBox instead, but they will halt the execution of the script which is not allways desirable. However, Event Logger and/or Event Viewer would log/display such messages without any break of the execution.
Here is what you should do if you want to use Event Viewer to display messages from your script:
- install Event Logger add-on;
- add the line Script.Include "Auto\EventLogger.vbs to your code, e.g. on its begin or end;
- add the line ViewEvent "some_text_e_g_script_name", "actual_text_e_g_some_variable" anywhere where you want to get the displayed message (for example, I could put ViewEvent "Magic Nodes", SDB.MainTree.CurrentNode.Caption in the OnChangedSelection event handler of my script);
- restart the program or use Script.Reload.
If you want to log messages, i.e. to get messages saved to the log file, you should use the LogEvent "abc", "xyz" syntax instead.