<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.mediamonkey.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Imd1b4u</id>
	<title>MediaMonkey Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.mediamonkey.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Imd1b4u"/>
	<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/Special:Contributions/Imd1b4u"/>
	<updated>2026-05-23T15:06:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.4</generator>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=Introduction_to_scripting&amp;diff=2847</id>
		<title>Introduction to scripting</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=Introduction_to_scripting&amp;diff=2847"/>
		<updated>2007-10-10T21:50:05Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: /* Considerations */ Fixed up point about database&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MediaMonkey can be customized through the use of custom scripts. Scripts are relatively simple computer programs written in a scripting language, such as VBScript. Unlike most computer programs, these scripts do not have to be compiled, which allows them to be tested and modified more easily than with more advanced languages. Still, writing MediaMonkey scripts can be a challenging experience so potential script writers should consider alternatives, particularly if they have little previous experience writing scripts.&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
Before writing their own scripts, users of MediaMonkey may wish to consider the following issues:&lt;br /&gt;
*In addition to supporting scripting, MediaMonkey has a [[Plug-ins|plug-in]] interface that allows a large number of Winamp and MediaMonkey plug-ins to be used. There may be no need to write a script if the desired features are already provided by a plug-in.&lt;br /&gt;
*Some users of MediaMonkey are willing to share the scripts that they have written with other users. An existing script may already provide the desired features or be relatively easily modified so that it does. The best place to find such scripts or to get support for them is the [http://www.mediamonkey.com/forum/viewforum.php?f=2 Scripts and Components forum].&lt;br /&gt;
*Although, in theory, MediaMonkey supports both of the [http://en.wikipedia.org/wiki/VBScript VBScript] (*.vbs) and [http://en.wikipedia.org/wiki/JScript JScript] (*.js) scripting languages, the implementation for JScript is only partial, so only VBScript can be used for some purposes. Programmers not wishing to deal with the idiosyncrasies of VBScript may wish to create an [[#About external scripts and applications |external]] script or application using their preferred language and use a script written in VBScript (or JScript) to launch it.&lt;br /&gt;
*MediaMonkey’s [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface] (API) is somewhat poorly designed and its implementation is rather buggy. The official documentation for it is very limited and occasionally misleading or incorrect. Some users of MediaMonkey are attempting to provide [[Scripting|more information]] in this wiki, but little has been written yet. Some people with scripting experience are willing to help others in the [http://www.mediamonkey.com/forum/viewforum.php?f=2 Scripts and Components forum] and scripts already written by others can serve as examples. Still, a considerable amount of trial-and-error is necessary to develop an understanding of the MediaMonkey scripting API.&lt;br /&gt;
*Other than tags embedded in media files, virtually all of MediaMonkey’s data is stored in a [http://en.wikipedia.org/wiki/Microsoft_Jet_Database_Engine Microsoft Jet] relational database by MediaMonkey 2.x, while MediaMonkey 3.x uses a [http://www.sqlite.org SQLite] database. It is possible to manipulate MediaMonkey’s data, while minimizing the use of MediaMonkey’s API, by using [http://en.wikipedia.org/wiki/SQL SQL]. MediaMonkey&#039;s API can be completely bypassed by using an interface provided by the underlying engine to access the database. MediaMonkey 2.x’s database can accessed through Jet or ODBC, or even opened directly by Microsoft Access, for example.&lt;br /&gt;
&lt;br /&gt;
== Types of scripts ==&lt;br /&gt;
&lt;br /&gt;
There are three major types of scripts that can be launched internally by MediaMonkey:&lt;br /&gt;
*&#039;&#039;&#039;Normal scripts&#039;&#039;&#039; are located in the &#039;&#039;Scripts&#039;&#039; folder and are executed according to the script&#039;s entry in the [[#Format of the Scripts.ini file|&#039;&#039;Scripts\Scripts.ini&#039;&#039; file]].&lt;br /&gt;
*&#039;&#039;&#039;Auto-scripts&#039;&#039;&#039; are located in the &#039;&#039;Scripts\Auto&#039;&#039; folder and its OnStartup method is executed when MediaMonkey starts.&lt;br /&gt;
*&#039;&#039;&#039;Other scripts&#039;&#039;&#039;, such as [[Search scripts]] and [[Auto-DJ scripts]] are intended for specific types of customization, but are also defined in the [[#Format of the Scripts.ini file|&#039;&#039;Scripts\Scripts.ini&#039;&#039; file]].&lt;br /&gt;
&lt;br /&gt;
In addition to the scripts that are launched by MediaMonkey (internal scripts), you can also work with MediaMonkey by using [[#About external scripts and applications|&#039;&#039;external&#039;&#039; scripts and applications]].&lt;br /&gt;
&lt;br /&gt;
== How to create a normal script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a plain text file in the &#039;&#039;Scripts&#039;&#039; folder, e.g. &#039;&#039;MyNormalScript.vbs&#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Write your VBScript script and make sure you have a procedure that can be called, e.g.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;Sub CallMe&lt;br /&gt;
&lt;br /&gt;
    &#039; This script will pop up a simple message box when the procedure CallMe is called.&lt;br /&gt;
    MsgBox &amp;quot;CallMe was called by the action defined in the Scripts.ini file.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
End Sub&amp;lt;/source&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new entry for your script&#039;s &#039;&#039;CallMe&#039;&#039; procedure in the [[#Format of the Scripts.ini file|&#039;&#039;Scripts.ini&#039;&#039; file]].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From within a MediaMonkey script, a reference to the SDB object (an instance of the [[SDBApplication]] class) is always present. By accessing its properties and methods, you can interact with many aspects of MediaMonkey. Check out the [[MediaMonkey Automation objects]] page for other MediaMonkey objects that can be created starting from the SDB object.&lt;br /&gt;
Another available object reference is the Script object (an instance of the [[SDBScriptControl]] class), that contains methods to control the running script&#039;s environment, usually to [[ISDBScriptControl::RegisterEvent|attach]] to events of MediaMonkey and its player and controls (see examples [[Sample Event Handlers script|1]] and [[Sample Events for User Interface script|2]]).&lt;br /&gt;
&lt;br /&gt;
The script &#039;&#039;Scripts\MediaMonkey init.vbs&#039;&#039; is always executed just before any other script. It contains some constants that can be used in your own script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good and quite complex example is &#039;&#039;Scripts\Export.vbs&#039;&#039; (distributed with MediaMonkey) which contains code that takes care of all export features of MediaMonkey. For more examples, check out the [[Sample scripts|sample scripts page]].&lt;br /&gt;
&lt;br /&gt;
More information about scripting in general can be found at [http://msdn2.microsoft.com/en-us/library/ms950396.aspx Microsoft Scripting] (with official VBScript and JScript documentation).&lt;br /&gt;
&lt;br /&gt;
== How to create an auto-script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a plain text file in the &#039;&#039;Scripts\Auto&#039;&#039; folder, e.g. &#039;&#039;MyAutoScript.vbs&#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Write your VBScript script and use the procedure &#039;&#039;OnStartup&#039;&#039; as start point for execution, e.g.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
Sub OnStartup&lt;br /&gt;
&lt;br /&gt;
    &#039; This script will pop up a simple &amp;quot;Hello World!&amp;quot; message box when you start MediaMonkey.&lt;br /&gt;
    MsgBox &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All VBScript, but not JScript, scripts in the &#039;&#039;Scripts\Auto&#039;&#039; folder are automatically checked during MM start-up, and the &#039;&#039;&#039;OnStartup&#039;&#039;&#039; procedure (if present) is called. Auto-scripts make it possible to add user interface enhancements such as new menu or toolbar items, new option sheets, etc.&lt;br /&gt;
&lt;br /&gt;
Except that these scripts are automatically executed when MediaMonkey starts, they behave identical as the normal scripts. They also get a reference to the SDB object, and the constants defined in &#039;&#039;Scripts\MediaMonkey init.vbs&#039;&#039; are always usable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Format of the &#039;&#039;Scripts.ini&#039;&#039; file ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; margin-left: 1em; margin-bottom: 0.5em; clear: right; background-color:#F9F9F9; border:1px solid #CCCCCC; font-size:95%; padding:5px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[AutoIncTrackN]&lt;br /&gt;
FileName=AutoIncTrackN.vbs&lt;br /&gt;
ProcName=AutoIncTrackNumbers&lt;br /&gt;
Order=1&lt;br /&gt;
DisplayName=Auto-&amp;amp;increment Track #s...&lt;br /&gt;
Description=Sequentially numbers Tracks&lt;br /&gt;
Language=VBScript&lt;br /&gt;
ScriptType=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;position: relative; top: -6px; left: 5px&amp;quot;&amp;gt;Sample &#039;&#039;Scripts.ini&#039;&#039; entry&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This &#039;&#039;Scripts\Scripts.ini&#039;&#039; file is a standard .ini file where each section defines a procedure in a script. The section starts with a section identifier [SectionName], where ‘SectionName’ is a unique name of the script entry.&lt;br /&gt;
These are the entry&#039;s properties:&lt;br /&gt;
; Filename&lt;br /&gt;
: Path of a script file where the procedure is located, relative to the &#039;&#039;Scripts&#039;&#039; folder, e.g. ‘MyScripts.vbs’.&lt;br /&gt;
; ProcName&lt;br /&gt;
: Name of an existing procedure to be called when the script (specifiedby ‘Filename’) is executed in MM.&lt;br /&gt;
; ScriptType&lt;br /&gt;
: Defines type of the script:&lt;br /&gt;
:*	0 = A &#039;&#039;standard script&#039;&#039; that appears in the &amp;lt;code&amp;gt;Tools &amp;gt; Scripts&amp;lt;/code&amp;gt; submenu.&lt;br /&gt;
:*	1 = An &#039;&#039;export script&#039;&#039; that can be found in the &amp;lt;code&amp;gt;File &amp;gt; Export&amp;lt;/code&amp;gt; submenu.&lt;br /&gt;
:*	2 = A &#039;&#039;track-start script&#039;&#039; that is activated whenever a new track is started. This script doesn’t appear in any menu, it’s simply called in the background. When this procedure is executed, a variable &#039;CurrentTrack&#039; (object of the [[SDBSongData]] class) is defined, and you can use it to get information about the started track.&lt;br /&gt;
:*      3 = A &#039;&#039;search script&#039;&#039; that allows custom searches to be programmed in the &amp;quot;Auto-tag from Web&amp;quot; dialog. See [[Search scripts]] for more information about this more complex script type.&lt;br /&gt;
:*      4 = An &#039;&#039;Auto-DJ script&#039;&#039; that can handle content added by Auto-DJ. See [[Auto-DJ scripts]] for more details.&lt;br /&gt;
; Order&lt;br /&gt;
: Defines the order of the script in its section. These numbers are sorted and scripts are listed according to the order.&lt;br /&gt;
; DisplayName&lt;br /&gt;
: The script is listed as menu item with this name.&lt;br /&gt;
; Description&lt;br /&gt;
: Message shown as tooltip when the mouse is moved over the menu item.&lt;br /&gt;
; Language&lt;br /&gt;
: The script language of the referenced script. Usually VBScript, but can be JScript too (although this is not recommended).&lt;br /&gt;
; Shortcut&lt;br /&gt;
: Specifies a shortcut that invokes the script in MM. You can use any of the strings ‘Shift+’, ‘Ctrl+’ or ‘Alt+’, even combined together and followed either by a single letter or a special key (BkSp, Tab, Enter, Esc, Space, PgUp, PgDn, End, Home, Left, Up, Right, Down, Ins, Del).&lt;br /&gt;
&lt;br /&gt;
== About external scripts and applications ==&lt;br /&gt;
&lt;br /&gt;
External scripts are launched from outside MediaMonkey. They can be scripts that are started by a MediaMonkey script (e.g. &#039;&#039;helper scripts&#039;&#039;), or that originated outside MediaMonkey (regular *.vbs scripts, local html pages, ASP server pages, ...). The same situation applies to applications that are not a part of MediaMonkey, but which use its COM object (the COM and the scripting API are the same).&lt;br /&gt;
&lt;br /&gt;
In order to work with MediaMonkey’s objects from outside a MediaMonkey script, you need to create a reference to the SDB object (an instance of the [[SDBApplication]] class) yourself. For external applications, make sure that you have added a reference to the SongsDB library, first.&lt;br /&gt;
&lt;br /&gt;
If MediaMonkey is already running, a call to the SDB object will return a reference to the running instance. If MediaMonkey is not running yet, it will be started and a reference will be returned. In addition, if MediaMonkey was was not running before, it will normally shut down automatically when the external script/application exits. This can be prevented (MediaMonkey will remain running) by setting SDB&#039;s [[ISDBApplication::ShutdownAfterDisconnect|ShutdownAfterDisconnect]] property to False.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visual Basic / VBScript sample:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
Dim SDB : Set SDB = CreateObject(&amp;quot;SongsDB.SDBApplication&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
SDB.ShutdownAfterDisconnect = False    &#039; in case you want to keep an opened instance open after disconnecting the SDB object&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;C# sample:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
SongsDB.SDBApplicationClass SDB = new SongsDB.SDBApplicationClass();&lt;br /&gt;
&lt;br /&gt;
SDB.ShutdownAfterDisconnect = false;    // in case you want to keep an opened instance open after disconnecting the SDB object&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Delphi sample:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;delphi&amp;quot;&amp;gt;&lt;br /&gt;
var &lt;br /&gt;
  SDB : Variant; &lt;br /&gt;
begin &lt;br /&gt;
  SDB := CreateObject(&#039;SongsDB.SDBApplication&#039;);&lt;br /&gt;
  SDB.ShutdownAfterDisconnect := false;    // in case you want to keep an opened instance open after disconnecting the SDB object&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PHP sample:&#039;&#039;&#039; (shows initialization only)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$objSDB = new COM(&#039;SongsDB.SDBApplication&#039;) or die(&#039;Cannot create MediaMonkey SDB Object&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=Introduction_to_scripting&amp;diff=2846</id>
		<title>Introduction to scripting</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=Introduction_to_scripting&amp;diff=2846"/>
		<updated>2007-10-10T21:06:13Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: New Introduction and Considerations plus minor stuff&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MediaMonkey can be customized through the use of custom scripts. Scripts are relatively simple computer programs written in a scripting language, such as VBScript. Unlike most computer programs, these scripts do not have to be compiled, which allows them to be tested and modified more easily than with more advanced languages. Still, writing MediaMonkey scripts can be a challenging experience so potential script writers should consider alternatives, particularly if they have little previous experience writing scripts.&lt;br /&gt;
&lt;br /&gt;
== Considerations ==&lt;br /&gt;
&lt;br /&gt;
Before writing their own scripts, users of MediaMonkey may wish to consider the following issues:&lt;br /&gt;
*In addition to supporting scripting, MediaMonkey has a [[Plug-ins|plug-in]] interface that allows a large number of Winamp and MediaMonkey plug-ins to be used. There may be no need to write a script if the desired features are already provided by a plug-in.&lt;br /&gt;
*Some users of MediaMonkey are willing to share the scripts that they have written with other users. An existing script may already provide the desired features or be relatively easily modified so that it does. The best place to find such scripts or to get support for them is the [http://www.mediamonkey.com/forum/viewforum.php?f=2 Scripts and Components forum].&lt;br /&gt;
*Although, in theory, MediaMonkey supports both of the [http://en.wikipedia.org/wiki/VBScript VBScript] (*.vbs) and [http://en.wikipedia.org/wiki/JScript JScript] (*.js) scripting languages, the implementation for JScript is only partial, so only VBScript can be used for some purposes. Programmers not wishing to deal with the idiosyncrasies of VBScript may wish to create an [[#About external scripts and applications |external]] script or application using their preferred language and use a script written in VBScript (or JScript) to launch it.&lt;br /&gt;
*MediaMonkey’s [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface] (API) is somewhat poorly designed and its implementation is rather buggy. The official documentation for it is very limited and occasionally misleading or incorrect. Some users of MediaMonkey are attempting to provide [[Scripting|more information]] in this wiki, but little has been written yet. Some people with scripting experience are willing to help others in the [http://www.mediamonkey.com/forum/viewforum.php?f=2 Scripts and Components forum] and scripts already written by others can serve as examples. Still, a considerable amount of trial-and-error is necessary to develop an understanding of the MediaMonkey scripting API.&lt;br /&gt;
*Other than tags embedded in media files, virtually all of MediaMonkey’s data is stored in a [http://en.wikipedia.org/wiki/Microsoft_Jet_Database_Engine Microsoft Jet] relational database by MediaMonkey 2.x, while MediaMonkey 3.x uses a [http://www.sqlite.org SQLite] database. It is possible to manipulate MediaMonkey’s database, while avoiding or minimizing the use of MediaMonkey’s API, by using [http://en.wikipedia.org/wiki/SQL SQL]. SQL statements and queries can be directed at the database through MediaMonkey’s API or some other interface. MediaMonkey 2.x’s database can accessed through Jet or ODBC, or even opened directly by Microsoft Access, for example.&lt;br /&gt;
&lt;br /&gt;
== Types of scripts ==&lt;br /&gt;
&lt;br /&gt;
There are three major types of scripts that can be launched internally by MediaMonkey:&lt;br /&gt;
*&#039;&#039;&#039;Normal scripts&#039;&#039;&#039; are located in the &#039;&#039;Scripts&#039;&#039; folder and are executed according to the script&#039;s entry in the [[#Format of the Scripts.ini file|&#039;&#039;Scripts\Scripts.ini&#039;&#039; file]].&lt;br /&gt;
*&#039;&#039;&#039;Auto-scripts&#039;&#039;&#039; are located in the &#039;&#039;Scripts\Auto&#039;&#039; folder and its OnStartup method is executed when MediaMonkey starts.&lt;br /&gt;
*&#039;&#039;&#039;Other scripts&#039;&#039;&#039;, such as [[Search scripts]] and [[Auto-DJ scripts]] are intended for specific types of customization, but are also defined in the [[#Format of the Scripts.ini file|&#039;&#039;Scripts\Scripts.ini&#039;&#039; file]].&lt;br /&gt;
&lt;br /&gt;
In addition to the scripts that are launched by MediaMonkey (internal scripts), you can also work with MediaMonkey by using [[#About external scripts and applications|&#039;&#039;external&#039;&#039; scripts and applications]].&lt;br /&gt;
&lt;br /&gt;
== How to create a normal script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a plain text file in the &#039;&#039;Scripts&#039;&#039; folder, e.g. &#039;&#039;MyNormalScript.vbs&#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Write your VBScript script and make sure you have a procedure that can be called, e.g.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;Sub CallMe&lt;br /&gt;
&lt;br /&gt;
    &#039; This script will pop up a simple message box when the procedure CallMe is called.&lt;br /&gt;
    MsgBox &amp;quot;CallMe was called by the action defined in the Scripts.ini file.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
End Sub&amp;lt;/source&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new entry for your script&#039;s &#039;&#039;CallMe&#039;&#039; procedure in the [[#Format of the Scripts.ini file|&#039;&#039;Scripts.ini&#039;&#039; file]].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From within a MediaMonkey script, a reference to the SDB object (an instance of the [[SDBApplication]] class) is always present. By accessing its properties and methods, you can interact with many aspects of MediaMonkey. Check out the [[MediaMonkey Automation objects]] page for other MediaMonkey objects that can be created starting from the SDB object.&lt;br /&gt;
Another available object reference is the Script object (an instance of the [[SDBScriptControl]] class), that contains methods to control the running script&#039;s environment, usually to [[ISDBScriptControl::RegisterEvent|attach]] to events of MediaMonkey and its player and controls (see examples [[Sample Event Handlers script|1]] and [[Sample Events for User Interface script|2]]).&lt;br /&gt;
&lt;br /&gt;
The script &#039;&#039;Scripts\MediaMonkey init.vbs&#039;&#039; is always executed just before any other script. It contains some constants that can be used in your own script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good and quite complex example is &#039;&#039;Scripts\Export.vbs&#039;&#039; (distributed with MediaMonkey) which contains code that takes care of all export features of MediaMonkey. For more examples, check out the [[Sample scripts|sample scripts page]].&lt;br /&gt;
&lt;br /&gt;
More information about scripting in general can be found at [http://msdn2.microsoft.com/en-us/library/ms950396.aspx Microsoft Scripting] (with official VBScript and JScript documentation).&lt;br /&gt;
&lt;br /&gt;
== How to create an auto-script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a plain text file in the &#039;&#039;Scripts\Auto&#039;&#039; folder, e.g. &#039;&#039;MyAutoScript.vbs&#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Write your VBScript script and use the procedure &#039;&#039;OnStartup&#039;&#039; as start point for execution, e.g.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
Sub OnStartup&lt;br /&gt;
&lt;br /&gt;
    &#039; This script will pop up a simple &amp;quot;Hello World!&amp;quot; message box when you start MediaMonkey.&lt;br /&gt;
    MsgBox &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All VBScript, but not JScript, scripts in the &#039;&#039;Scripts\Auto&#039;&#039; folder are automatically checked during MM start-up, and the &#039;&#039;&#039;OnStartup&#039;&#039;&#039; procedure (if present) is called. Auto-scripts make it possible to add user interface enhancements such as new menu or toolbar items, new option sheets, etc.&lt;br /&gt;
&lt;br /&gt;
Except that these scripts are automatically executed when MediaMonkey starts, they behave identical as the normal scripts. They also get a reference to the SDB object, and the constants defined in &#039;&#039;Scripts\MediaMonkey init.vbs&#039;&#039; are always usable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Format of the &#039;&#039;Scripts.ini&#039;&#039; file ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; margin-left: 1em; margin-bottom: 0.5em; clear: right; background-color:#F9F9F9; border:1px solid #CCCCCC; font-size:95%; padding:5px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[AutoIncTrackN]&lt;br /&gt;
FileName=AutoIncTrackN.vbs&lt;br /&gt;
ProcName=AutoIncTrackNumbers&lt;br /&gt;
Order=1&lt;br /&gt;
DisplayName=Auto-&amp;amp;increment Track #s...&lt;br /&gt;
Description=Sequentially numbers Tracks&lt;br /&gt;
Language=VBScript&lt;br /&gt;
ScriptType=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;position: relative; top: -6px; left: 5px&amp;quot;&amp;gt;Sample &#039;&#039;Scripts.ini&#039;&#039; entry&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This &#039;&#039;Scripts\Scripts.ini&#039;&#039; file is a standard .ini file where each section defines a procedure in a script. The section starts with a section identifier [SectionName], where ‘SectionName’ is a unique name of the script entry.&lt;br /&gt;
These are the entry&#039;s properties:&lt;br /&gt;
; Filename&lt;br /&gt;
: Path of a script file where the procedure is located, relative to the &#039;&#039;Scripts&#039;&#039; folder, e.g. ‘MyScripts.vbs’.&lt;br /&gt;
; ProcName&lt;br /&gt;
: Name of an existing procedure to be called when the script (specifiedby ‘Filename’) is executed in MM.&lt;br /&gt;
; ScriptType&lt;br /&gt;
: Defines type of the script:&lt;br /&gt;
:*	0 = A &#039;&#039;standard script&#039;&#039; that appears in the &amp;lt;code&amp;gt;Tools &amp;gt; Scripts&amp;lt;/code&amp;gt; submenu.&lt;br /&gt;
:*	1 = An &#039;&#039;export script&#039;&#039; that can be found in the &amp;lt;code&amp;gt;File &amp;gt; Export&amp;lt;/code&amp;gt; submenu.&lt;br /&gt;
:*	2 = A &#039;&#039;track-start script&#039;&#039; that is activated whenever a new track is started. This script doesn’t appear in any menu, it’s simply called in the background. When this procedure is executed, a variable &#039;CurrentTrack&#039; (object of the [[SDBSongData]] class) is defined, and you can use it to get information about the started track.&lt;br /&gt;
:*      3 = A &#039;&#039;search script&#039;&#039; that allows custom searches to be programmed in the &amp;quot;Auto-tag from Web&amp;quot; dialog. See [[Search scripts]] for more information about this more complex script type.&lt;br /&gt;
:*      4 = An &#039;&#039;Auto-DJ script&#039;&#039; that can handle content added by Auto-DJ. See [[Auto-DJ scripts]] for more details.&lt;br /&gt;
; Order&lt;br /&gt;
: Defines the order of the script in its section. These numbers are sorted and scripts are listed according to the order.&lt;br /&gt;
; DisplayName&lt;br /&gt;
: The script is listed as menu item with this name.&lt;br /&gt;
; Description&lt;br /&gt;
: Message shown as tooltip when the mouse is moved over the menu item.&lt;br /&gt;
; Language&lt;br /&gt;
: The script language of the referenced script. Usually VBScript, but can be JScript too (although this is not recommended).&lt;br /&gt;
; Shortcut&lt;br /&gt;
: Specifies a shortcut that invokes the script in MM. You can use any of the strings ‘Shift+’, ‘Ctrl+’ or ‘Alt+’, even combined together and followed either by a single letter or a special key (BkSp, Tab, Enter, Esc, Space, PgUp, PgDn, End, Home, Left, Up, Right, Down, Ins, Del).&lt;br /&gt;
&lt;br /&gt;
== About external scripts and applications ==&lt;br /&gt;
&lt;br /&gt;
External scripts are launched from outside MediaMonkey. They can be scripts that are started by a MediaMonkey script (e.g. &#039;&#039;helper scripts&#039;&#039;), or that originated outside MediaMonkey (regular *.vbs scripts, local html pages, ASP server pages, ...). The same situation applies to applications that are not a part of MediaMonkey, but which use its COM object (the COM and the scripting API are the same).&lt;br /&gt;
&lt;br /&gt;
In order to work with MediaMonkey’s objects from outside a MediaMonkey script, you need to create a reference to the SDB object (an instance of the [[SDBApplication]] class) yourself. For external applications, make sure that you have added a reference to the SongsDB library, first.&lt;br /&gt;
&lt;br /&gt;
If MediaMonkey is already running, a call to the SDB object will return a reference to the running instance. If MediaMonkey is not running yet, it will be started and a reference will be returned. In addition, if MediaMonkey was was not running before, it will normally shut down automatically when the external script/application exits. This can be prevented (MediaMonkey will remain running) by setting SDB&#039;s [[ISDBApplication::ShutdownAfterDisconnect|ShutdownAfterDisconnect]] property to False.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visual Basic / VBScript sample:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
Dim SDB : Set SDB = CreateObject(&amp;quot;SongsDB.SDBApplication&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
SDB.ShutdownAfterDisconnect = False    &#039; in case you want to keep an opened instance open after disconnecting the SDB object&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;C# sample:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
SongsDB.SDBApplicationClass SDB = new SongsDB.SDBApplicationClass();&lt;br /&gt;
&lt;br /&gt;
SDB.ShutdownAfterDisconnect = false;    // in case you want to keep an opened instance open after disconnecting the SDB object&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Delphi sample:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;delphi&amp;quot;&amp;gt;&lt;br /&gt;
var &lt;br /&gt;
  SDB : Variant; &lt;br /&gt;
begin &lt;br /&gt;
  SDB := CreateObject(&#039;SongsDB.SDBApplication&#039;);&lt;br /&gt;
  SDB.ShutdownAfterDisconnect := false;    // in case you want to keep an opened instance open after disconnecting the SDB object&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PHP sample:&#039;&#039;&#039; (shows initialization only)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$objSDB = new COM(&#039;SongsDB.SDBApplication&#039;) or die(&#039;Cannot create MediaMonkey SDB Object&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=ISDBSongData::Author&amp;diff=2845</id>
		<title>ISDBSongData::Author</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=ISDBSongData::Author&amp;diff=2845"/>
		<updated>2007-10-10T16:54:32Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: /* Property description */ Changed wording of my previous edit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MethodDeclaration|SDBSongData|ISDBSongData|Property Get/Let Author As String}}&lt;br /&gt;
&lt;br /&gt;
===Property description===&lt;br /&gt;
&lt;br /&gt;
There is a redundant property, [[ISDBSongData::MusicComposer]], in Media Monkey 2.5. Based on limited testing it appears that this property (Author) is the property to use. The [[ISDBSongData::UpdateDB]] and [[ISDBSongData::WriteTags]] methods seem to use the value from Author rather than the value in the [[ISDBSongData::MusicComposer]] property. Also, this value can be used to display data already in the database, while [[ISDBSongData::MusicComposer]] apparently does not.&lt;br /&gt;
&lt;br /&gt;
The situation under MediaMonkey version 3.x is unknown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Automation objects|{{PAGENAME}}]]&lt;br /&gt;
[[Category:CoClass SDBSongData|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Interface ISDBSongData|{{PAGENAME}}]]&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=ISDBSongData::Author&amp;diff=2844</id>
		<title>ISDBSongData::Author</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=ISDBSongData::Author&amp;diff=2844"/>
		<updated>2007-10-10T16:48:06Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: /* Property description */ Changed wording of my previous edit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MethodDeclaration|SDBSongData|ISDBSongData|Property Get/Let Author As String}}&lt;br /&gt;
&lt;br /&gt;
===Property description===&lt;br /&gt;
&lt;br /&gt;
There is a redundant property, [[ISDBSongData::MusicComposer]], in Media Monkey 2.5. Based on limited testing it appears that Author is the property to use. The [[ISDBSongData::UpdateDB]] and [[ISDBSongData::WriteTags]] use the value from Author, not the value in the [[ISDBSongData::MusicComposer]] property. Also, this value can be used to display data already in the database, while [[ISDBSongData::MusicComposer]] apparently does not.&lt;br /&gt;
&lt;br /&gt;
The situation under MediaMonkey version 3.x is unknown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Automation objects|{{PAGENAME}}]]&lt;br /&gt;
[[Category:CoClass SDBSongData|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Interface ISDBSongData|{{PAGENAME}}]]&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=Database_Structure&amp;diff=2843</id>
		<title>Database Structure</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=Database_Structure&amp;diff=2843"/>
		<updated>2007-10-10T07:08:37Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: /* AddSongInfo */ Cleaned up my previous edit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DatabaseTablesList}}&lt;br /&gt;
&lt;br /&gt;
== Database type ==&lt;br /&gt;
[http://www.sqlite.org SQLite] version 3&lt;br /&gt;
* Encoding: UTF-16le&lt;br /&gt;
* Text collate IUNICODE (except where indicated with a (*))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Database location ==&lt;br /&gt;
&#039;&#039;&#039;Windows XP:&#039;&#039;&#039; C:\Documents and Settings\&amp;lt;USERNAME&amp;gt;\Local Settings\Application Data\MediaMonkey\MM.DB&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Windows Vista:&#039;&#039;&#039; C:\Users\&amp;lt;USERNAME&amp;gt;\AppData\Local\MediaMonkey\MM.DB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used data types ==&lt;br /&gt;
&#039;&#039;&#039;INTEGER&#039;&#039;&#039; The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;REAL&#039;&#039;&#039; The value is a floating point value, stored as an 8-byte IEEE floating point number.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;TEXT&#039;&#039;&#039; The value is a text string, stored using the database encoding (UTF-16-LE).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Structure explanation ==&lt;br /&gt;
The most important table is the &#039;&#039;Songs&#039;&#039; table, which is the starting point for all song-specific info. To allow rapid requests, most of the information is present in the table itself, e.g. the Artist name is spelled out.&lt;br /&gt;
The link between table Songs and other tables like Artists, Albums, ... happens with intermediary tables, e.g. ArtistsSongs. This allows us to assign multiple songs to one artist, AND multiple artists to one song.&lt;br /&gt;
&lt;br /&gt;
The database contains custom events, called &amp;quot;triggers&amp;quot;, that are executed when e.g. an artist is assigned to a track. For that example, the trigger will automatically increment the Artists table&#039;s Tracks counter field.&lt;br /&gt;
&lt;br /&gt;
== Database tables ==&lt;br /&gt;
*[[Albums table|Albums]]: All info about a certain album.&lt;br /&gt;
*[[Artists table|Artists]]&lt;br /&gt;
*[[ArtistsAlbums table|ArtistsAlbums]]&lt;br /&gt;
*[[ArtistsSongs table|ArtistsSongs]]&lt;br /&gt;
*[[Covers table|Covers]]&lt;br /&gt;
*[[DBInfo table|DBInfo]]&lt;br /&gt;
*[[DeviceFilters table|DeviceFilters]]&lt;br /&gt;
*[[DeviceTracks table|DeviceTracks]]&lt;br /&gt;
*[[Devices table|Devices]]&lt;br /&gt;
*[[Filters table|Filters]]&lt;br /&gt;
*[[Folders table|Folders]]&lt;br /&gt;
*[[FoldersHier table|FoldersHier]]&lt;br /&gt;
*[[Genres table|Genres]]&lt;br /&gt;
*[[GenresSongs table|GenresSongs]]&lt;br /&gt;
*[[LastTreePath table|LastTreePath]]&lt;br /&gt;
*[[Lists table|Lists]]&lt;br /&gt;
*[[ListsSongs table|ListsSongs]]&lt;br /&gt;
*[[Medias table|Medias]]&lt;br /&gt;
*[[OrganizeRules table|OrganizeRules]]&lt;br /&gt;
*[[PathProcessing table|PathProcessing]]&lt;br /&gt;
*[[Played table|Played]]&lt;br /&gt;
*[[PlaylistSongs table|PlaylistSongs]]&lt;br /&gt;
*[[Playlists table|Playlists]]&lt;br /&gt;
*[[PodcastDirs table|PodcastDirs]]&lt;br /&gt;
*[[PodcastEpisodes table|PodcastEpisodes]]&lt;br /&gt;
*[[Podcasts table|Podcasts]]&lt;br /&gt;
*[[Songs table|Songs]]&lt;br /&gt;
*[[SynchAlbum table|SynchAlbum]]&lt;br /&gt;
*[[SynchArtist table|SynchArtist]]&lt;br /&gt;
*[[SynchLocation table|SynchLocation]]&lt;br /&gt;
*[[SynchPlaylist table|SynchPlaylist]]&lt;br /&gt;
*[[SynchPodcast table|SynchPodcast]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MediaMonkey v2.5 and lower==&lt;br /&gt;
&lt;br /&gt;
===Database structure===&lt;br /&gt;
[[Image:DatabaseRelationsMM2.gif|center|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===AddSongInfo===&lt;br /&gt;
&#039;&#039;Value field is &amp;quot;TextData&amp;quot;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DataType&#039;&#039;&#039;&lt;br /&gt;
{| border=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || AIF Code || Description&lt;br /&gt;
|-&lt;br /&gt;
| 100 || AIF_COPYRIGHT || Copyright&lt;br /&gt;
|-&lt;br /&gt;
| 101 || AIF_PUBLISHER || Publisher&lt;br /&gt;
|-&lt;br /&gt;
| 102 || AIF_ENCODER || Encoder&lt;br /&gt;
|-&lt;br /&gt;
| 103 || AIF_ENCODEDBY || Encoded By&lt;br /&gt;
|-&lt;br /&gt;
| 200 || AIF_LYRICIST || Lyricist&lt;br /&gt;
|-&lt;br /&gt;
| 201 || AIF_BAND || Band&lt;br /&gt;
|-&lt;br /&gt;
| 202 || AIF_CONDUCTOR || Conductor&lt;br /&gt;
|-&lt;br /&gt;
| 203 || AIF_REMIXER || Remixer&lt;br /&gt;
|-&lt;br /&gt;
| 204 || AIF_INVOLVEDPEOPLE || Involved People&lt;br /&gt;
|-&lt;br /&gt;
| 205 || AIF_MUSICCOMPOSER || (See note)&lt;br /&gt;
|-&lt;br /&gt;
| 300 || AIF_ORIGTITLE || Original Title&lt;br /&gt;
|-&lt;br /&gt;
| 301 || AIF_ORIGARTIST || Original Artist&lt;br /&gt;
|-&lt;br /&gt;
| 302 || AIF_ORIGLYRICIST || Original Lyricist&lt;br /&gt;
|-&lt;br /&gt;
| 400 || AIF_GROUPDESC || &lt;br /&gt;
|-&lt;br /&gt;
| 401 || AIF_SUBTITLE || &lt;br /&gt;
|-&lt;br /&gt;
| 402 || AIF_ISRC || &lt;br /&gt;
|-&lt;br /&gt;
| 500 || AIF_INITIALKEY || &lt;br /&gt;
|-&lt;br /&gt;
| 501 || AIF_LANGUAGE || &lt;br /&gt;
|-&lt;br /&gt;
| 502 || AIF_MEDIATYPE || &lt;br /&gt;
|-&lt;br /&gt;
| 503 || AIF_RATINGSTRING || &lt;br /&gt;
|-&lt;br /&gt;
| 1000 || AIF_WEB_COMMERCIAL || &lt;br /&gt;
|-&lt;br /&gt;
| 1001 || AIF_WEB_COPYRIGHT || &lt;br /&gt;
|-&lt;br /&gt;
| 1002 || AIF_WEB_FILEPAGE || &lt;br /&gt;
|-&lt;br /&gt;
| 1003 || AIF_WEB_ARTIST || &lt;br /&gt;
|-&lt;br /&gt;
| 1004 || AIF_WEB_SOURCE || &lt;br /&gt;
|-&lt;br /&gt;
| 1005 || AIF_WEB_RADIO || &lt;br /&gt;
|-&lt;br /&gt;
| 1006 || AIF_WEB_PAYMENT || &lt;br /&gt;
|-&lt;br /&gt;
| 1007 || AIF_WEB_PUBLISHER || &lt;br /&gt;
|-&lt;br /&gt;
| 1100 || AIF_WEB_USER || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: Apparently, the value for the composer is stored in the Author field of the Songs table rather than in the AddSongInfo table under MediaMonkey 2.5. The situation in other versions is unknown.&lt;br /&gt;
&lt;br /&gt;
===AddSongInfoInt===&lt;br /&gt;
&#039;&#039;Value field is &amp;quot;IntData&amp;quot;&#039;&#039; (linked to Lists.ID)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DataType&#039;&#039;&#039; (partially linked to Lists.IDListType)&lt;br /&gt;
{| border=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || AIF Code || Description&lt;br /&gt;
|-&lt;br /&gt;
| 10000 || AIF_ORIGYEAR || Original Year&lt;br /&gt;
|-&lt;br /&gt;
| 10101 || AIF_TEMPO || Tempo&lt;br /&gt;
|-&lt;br /&gt;
| 10102 || AIF_MOOD || Mood&lt;br /&gt;
|-&lt;br /&gt;
| 10103 || AIF_OCCASION || Occasion&lt;br /&gt;
|-&lt;br /&gt;
| 10104 || AIF_QUALITY || Quality&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Memos===&lt;br /&gt;
&#039;&#039;Value field is &amp;quot;MemoText&amp;quot;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MemoType&#039;&#039;&#039;&lt;br /&gt;
{| border=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || AIF Code || Description&lt;br /&gt;
|-&lt;br /&gt;
| 20000 || AIF_LYRICS || Lyrics&lt;br /&gt;
|-&lt;br /&gt;
| 20001 || AIF_COMMENT || Comment&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=Database_Structure&amp;diff=2842</id>
		<title>Database Structure</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=Database_Structure&amp;diff=2842"/>
		<updated>2007-10-10T07:07:14Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: /* AddSongInfo */  Note about how Composer is stored in MM2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DatabaseTablesList}}&lt;br /&gt;
&lt;br /&gt;
== Database type ==&lt;br /&gt;
[http://www.sqlite.org SQLite] version 3&lt;br /&gt;
* Encoding: UTF-16le&lt;br /&gt;
* Text collate IUNICODE (except where indicated with a (*))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Database location ==&lt;br /&gt;
&#039;&#039;&#039;Windows XP:&#039;&#039;&#039; C:\Documents and Settings\&amp;lt;USERNAME&amp;gt;\Local Settings\Application Data\MediaMonkey\MM.DB&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;Windows Vista:&#039;&#039;&#039; C:\Users\&amp;lt;USERNAME&amp;gt;\AppData\Local\MediaMonkey\MM.DB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used data types ==&lt;br /&gt;
&#039;&#039;&#039;INTEGER&#039;&#039;&#039; The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;REAL&#039;&#039;&#039; The value is a floating point value, stored as an 8-byte IEEE floating point number.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;TEXT&#039;&#039;&#039; The value is a text string, stored using the database encoding (UTF-16-LE).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Structure explanation ==&lt;br /&gt;
The most important table is the &#039;&#039;Songs&#039;&#039; table, which is the starting point for all song-specific info. To allow rapid requests, most of the information is present in the table itself, e.g. the Artist name is spelled out.&lt;br /&gt;
The link between table Songs and other tables like Artists, Albums, ... happens with intermediary tables, e.g. ArtistsSongs. This allows us to assign multiple songs to one artist, AND multiple artists to one song.&lt;br /&gt;
&lt;br /&gt;
The database contains custom events, called &amp;quot;triggers&amp;quot;, that are executed when e.g. an artist is assigned to a track. For that example, the trigger will automatically increment the Artists table&#039;s Tracks counter field.&lt;br /&gt;
&lt;br /&gt;
== Database tables ==&lt;br /&gt;
*[[Albums table|Albums]]: All info about a certain album.&lt;br /&gt;
*[[Artists table|Artists]]&lt;br /&gt;
*[[ArtistsAlbums table|ArtistsAlbums]]&lt;br /&gt;
*[[ArtistsSongs table|ArtistsSongs]]&lt;br /&gt;
*[[Covers table|Covers]]&lt;br /&gt;
*[[DBInfo table|DBInfo]]&lt;br /&gt;
*[[DeviceFilters table|DeviceFilters]]&lt;br /&gt;
*[[DeviceTracks table|DeviceTracks]]&lt;br /&gt;
*[[Devices table|Devices]]&lt;br /&gt;
*[[Filters table|Filters]]&lt;br /&gt;
*[[Folders table|Folders]]&lt;br /&gt;
*[[FoldersHier table|FoldersHier]]&lt;br /&gt;
*[[Genres table|Genres]]&lt;br /&gt;
*[[GenresSongs table|GenresSongs]]&lt;br /&gt;
*[[LastTreePath table|LastTreePath]]&lt;br /&gt;
*[[Lists table|Lists]]&lt;br /&gt;
*[[ListsSongs table|ListsSongs]]&lt;br /&gt;
*[[Medias table|Medias]]&lt;br /&gt;
*[[OrganizeRules table|OrganizeRules]]&lt;br /&gt;
*[[PathProcessing table|PathProcessing]]&lt;br /&gt;
*[[Played table|Played]]&lt;br /&gt;
*[[PlaylistSongs table|PlaylistSongs]]&lt;br /&gt;
*[[Playlists table|Playlists]]&lt;br /&gt;
*[[PodcastDirs table|PodcastDirs]]&lt;br /&gt;
*[[PodcastEpisodes table|PodcastEpisodes]]&lt;br /&gt;
*[[Podcasts table|Podcasts]]&lt;br /&gt;
*[[Songs table|Songs]]&lt;br /&gt;
*[[SynchAlbum table|SynchAlbum]]&lt;br /&gt;
*[[SynchArtist table|SynchArtist]]&lt;br /&gt;
*[[SynchLocation table|SynchLocation]]&lt;br /&gt;
*[[SynchPlaylist table|SynchPlaylist]]&lt;br /&gt;
*[[SynchPodcast table|SynchPodcast]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MediaMonkey v2.5 and lower==&lt;br /&gt;
&lt;br /&gt;
===Database structure===&lt;br /&gt;
[[Image:DatabaseRelationsMM2.gif|center|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===AddSongInfo===&lt;br /&gt;
&#039;&#039;Value field is &amp;quot;TextData&amp;quot;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DataType&#039;&#039;&#039;&lt;br /&gt;
{| border=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || AIF Code || Description&lt;br /&gt;
|-&lt;br /&gt;
| 100 || AIF_COPYRIGHT || Copyright&lt;br /&gt;
|-&lt;br /&gt;
| 101 || AIF_PUBLISHER || Publisher&lt;br /&gt;
|-&lt;br /&gt;
| 102 || AIF_ENCODER || Encoder&lt;br /&gt;
|-&lt;br /&gt;
| 103 || AIF_ENCODEDBY || Encoded By&lt;br /&gt;
|-&lt;br /&gt;
| 200 || AIF_LYRICIST || Lyricist&lt;br /&gt;
|-&lt;br /&gt;
| 201 || AIF_BAND || Band&lt;br /&gt;
|-&lt;br /&gt;
| 202 || AIF_CONDUCTOR || Conductor&lt;br /&gt;
|-&lt;br /&gt;
| 203 || AIF_REMIXER || Remixer&lt;br /&gt;
|-&lt;br /&gt;
| 204 || AIF_INVOLVEDPEOPLE || Involved People&lt;br /&gt;
|-&lt;br /&gt;
| 205 || AIF_MUSICCOMPOSER || See note&lt;br /&gt;
|-&lt;br /&gt;
| 300 || AIF_ORIGTITLE || Original Title&lt;br /&gt;
|-&lt;br /&gt;
| 301 || AIF_ORIGARTIST || Original Artist&lt;br /&gt;
|-&lt;br /&gt;
| 302 || AIF_ORIGLYRICIST || Original Lyricist&lt;br /&gt;
|-&lt;br /&gt;
| 400 || AIF_GROUPDESC || &lt;br /&gt;
|-&lt;br /&gt;
| 401 || AIF_SUBTITLE || &lt;br /&gt;
|-&lt;br /&gt;
| 402 || AIF_ISRC || &lt;br /&gt;
|-&lt;br /&gt;
| 500 || AIF_INITIALKEY || &lt;br /&gt;
|-&lt;br /&gt;
| 501 || AIF_LANGUAGE || &lt;br /&gt;
|-&lt;br /&gt;
| 502 || AIF_MEDIATYPE || &lt;br /&gt;
|-&lt;br /&gt;
| 503 || AIF_RATINGSTRING || &lt;br /&gt;
|-&lt;br /&gt;
| 1000 || AIF_WEB_COMMERCIAL || &lt;br /&gt;
|-&lt;br /&gt;
| 1001 || AIF_WEB_COPYRIGHT || &lt;br /&gt;
|-&lt;br /&gt;
| 1002 || AIF_WEB_FILEPAGE || &lt;br /&gt;
|-&lt;br /&gt;
| 1003 || AIF_WEB_ARTIST || &lt;br /&gt;
|-&lt;br /&gt;
| 1004 || AIF_WEB_SOURCE || &lt;br /&gt;
|-&lt;br /&gt;
| 1005 || AIF_WEB_RADIO || &lt;br /&gt;
|-&lt;br /&gt;
| 1006 || AIF_WEB_PAYMENT || &lt;br /&gt;
|-&lt;br /&gt;
| 1007 || AIF_WEB_PUBLISHER || &lt;br /&gt;
|-&lt;br /&gt;
| 1100 || AIF_WEB_USER || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: Apparently, the value for the composer is stored in the Author field of the Songs table rather than in the AddSongInfo table under MediaMonkey 2.5. The situation in other versions is unknown.&lt;br /&gt;
&lt;br /&gt;
===AddSongInfoInt===&lt;br /&gt;
&#039;&#039;Value field is &amp;quot;IntData&amp;quot;&#039;&#039; (linked to Lists.ID)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DataType&#039;&#039;&#039; (partially linked to Lists.IDListType)&lt;br /&gt;
{| border=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || AIF Code || Description&lt;br /&gt;
|-&lt;br /&gt;
| 10000 || AIF_ORIGYEAR || Original Year&lt;br /&gt;
|-&lt;br /&gt;
| 10101 || AIF_TEMPO || Tempo&lt;br /&gt;
|-&lt;br /&gt;
| 10102 || AIF_MOOD || Mood&lt;br /&gt;
|-&lt;br /&gt;
| 10103 || AIF_OCCASION || Occasion&lt;br /&gt;
|-&lt;br /&gt;
| 10104 || AIF_QUALITY || Quality&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Memos===&lt;br /&gt;
&#039;&#039;Value field is &amp;quot;MemoText&amp;quot;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MemoType&#039;&#039;&#039;&lt;br /&gt;
{| border=&amp;quot;2&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || AIF Code || Description&lt;br /&gt;
|-&lt;br /&gt;
| 20000 || AIF_LYRICS || Lyrics&lt;br /&gt;
|-&lt;br /&gt;
| 20001 || AIF_COMMENT || Comment&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=ISDBSongData::Author&amp;diff=2841</id>
		<title>ISDBSongData::Author</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=ISDBSongData::Author&amp;diff=2841"/>
		<updated>2007-10-10T06:56:48Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: /* Property description */  Documented relation with MusicComposer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MethodDeclaration|SDBSongData|ISDBSongData|Property Get/Let Author As String}}&lt;br /&gt;
&lt;br /&gt;
===Property description===&lt;br /&gt;
&lt;br /&gt;
This property has a redundant property, [[ISDBSongData::MusicComposer]], under Media Monkey 2.5. Based on limited testing it appears that Author is the property to use. The [[ISDBSongData::UpdateDB]] and [[ISDBSongData::WriteTags]] write the value from this property, not the value in the [[ISDBSongData::MusicComposer]] property. Also, this value can be used to display data already in the database, while [[ISDBSongData::MusicComposer]] apparently can not.&lt;br /&gt;
&lt;br /&gt;
The situation under MediaMonkey version 3.x is unknown.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Automation objects|{{PAGENAME}}]]&lt;br /&gt;
[[Category:CoClass SDBSongData|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Interface ISDBSongData|{{PAGENAME}}]]&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=ISDBSongData::MusicComposer&amp;diff=2840</id>
		<title>ISDBSongData::MusicComposer</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=ISDBSongData::MusicComposer&amp;diff=2840"/>
		<updated>2007-10-10T06:47:40Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: /* Property description */  Added warning that it is nonfunctional&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MethodDeclaration|SDBSongData|ISDBSongData|Property Get/Let MusicComposer As String}}&lt;br /&gt;
&lt;br /&gt;
===Property description===&lt;br /&gt;
&lt;br /&gt;
Warning: This property is redundant and does not appear to be implemented properly under MediaMonkey version 2.5. Although it may be possible to set this property to some value, based on limited testing, the [[ISDBSongData::UpdateDB]] and [[ISDBSongData::WriteTags]] methods appear to ignore this property. Instead, any value in the [[ISDBSongData::Author]] property is saved where one would expect the value for this property to be saved. Furthermore, this property does not seem to display any values from the database or music files. Apparently, [[ISDBSongData::Author]] should always be used instead of this property.&lt;br /&gt;
&lt;br /&gt;
The behavior of MusicComposer under MediaMonkey version 3.x is unknown.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Automation objects|{{PAGENAME}}]]&lt;br /&gt;
[[Category:CoClass SDBSongData|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Interface ISDBSongData|{{PAGENAME}}]]&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=Scripting_Tips_%26_Tricks_(MM4)&amp;diff=2839</id>
		<title>Scripting Tips &amp; Tricks (MM4)</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=Scripting_Tips_%26_Tricks_(MM4)&amp;diff=2839"/>
		<updated>2007-10-07T04:25:10Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: Added link to Iviewer.dll (required by OLEView)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==(MediaMonkey) Scripting in general==&lt;br /&gt;
&lt;br /&gt;
Using the SongData object, you can either update the database/library (UpdateDB) and/or update the file&#039;s tags (WriteTags). So there&#039;s no way to let the song changes be saved like the user selected in the Options panel (menu Tools &amp;gt; Options &amp;gt; Library &amp;gt; Tags &amp;amp; Playlists &amp;gt; &amp;quot;Update tags when editing properties&amp;quot;).&lt;br /&gt;
However, the UpdateAll method for the SongList object &#039;&#039;does&#039;&#039; take into account this user-specified option. So you can create a new SongList object using SDB.NewSongList and add your SDBSongData object(s) to it. Then call the UpdateAll method on the songlist, and your song(s) will be saved in user-specified way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MS Visual Studio contains a tool called [http://www.microsoft.com/downloads/details.aspx?familyid=5233B70D-D9B2-4CB5-AEB6-45664BE858B6&amp;amp;displaylang=en OLEView] (&amp;quot;OLE Viewer&amp;quot; or &amp;quot;OLE/COM Object Viewer&amp;quot;) ([http://download.microsoft.com/download/win2000platform/oleview/1.00.0.1/nt5/en-us/oleview_setup.exe direct link]), which can show the type library of the SongsDB object: &amp;quot;MediaMonkey Library&amp;quot;. It requires the Iviewers.dll, which is not included, but can be downloaded from [http://www.dlldll.com/downdll/2757.html here] or other 3rd-party locations. There, you can see all supported properties and methods of the MediaMonkey scripting interface. This can be handy to find out new scripting methods while the scripting help isn&#039;t up-to-date yet.&lt;br /&gt;
&amp;lt;br&amp;gt;The way to get there: &#039;&#039;OleView&#039;&#039; &amp;gt; Type Libraries &amp;gt; MediaMonkey Library &amp;gt; (double click)&lt;br /&gt;
&amp;lt;br&amp;gt;and then in the &#039;&#039;ITypeLib Viewer&#039;&#039; &amp;gt; SongsDB (MediaMonkey Library) &amp;gt; Interfaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you un(dock) a dockable panel, the OnResize event is triggered twice:&lt;br /&gt;
*Once while the panel is being (un)docked with DockedTo = 0&lt;br /&gt;
*Once after the panel has been (undocked): with DockedTo = -1 (panel undocked) or DockedTo = X (panel docked, X is the number that represents the docking position)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A dockable panel always has to be added to the SDB.Objects dictionary. If you don&#039;t add it, it will be gone immediately after you created it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are still 2 scripting mechanisms available:&lt;br /&gt;
*Using the (mostly deprecated) &#039;&#039;old event mechanism&#039;&#039; (using &#039;&#039;Control&#039;&#039;.OnClickFunc and &#039;&#039;Control&#039;&#039;.UseScript), your global variables aren&#039;t remembered in the event handlers (e.g. kind of like the script is reopened). For those scripts, you had to use &#039;&#039;ParentControl&#039;&#039;.ChildControl(&amp;quot;control name&amp;quot;) or save object references to SDB&#039;s &#039;&#039;Objects&#039;&#039; dictionary.&lt;br /&gt;
*Using the &#039;&#039;new event mechanism&#039;&#039;, your global variables &#039;&#039;are&#039;&#039; remembered so you can use their values in the event handlers. The Objects dictionary is now only necessary to communicate/store object references between different scripts.&lt;br /&gt;
==&amp;gt; So always use the new event mechanism where you can. Only for option panels (sheets) this is not yet possible. There you&#039;ll need to store values between the main program and the event handlers in SDB.Objects, in the INI or in the Registry.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changing the selected node from a script (using SDB.MainTree.CurrentNode = ...........) takes some time to happen, and it happens asynchronicly (the code execution doesn&#039;t wait until the node is really selected). For that reason, you can&#039;t use (get value of) SDB.MainTree.CurrentNode directly after you have assigned a new node to it (set value to), because changes won&#039;t have happened yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are at least three ways to interact with MediaMonkey from an external program:&lt;br /&gt;
*Open the MediaMonkey.exe program with command line options (arguments).&lt;br /&gt;
*Using the same Windows Messages (SendMessage/PostMessage) as in Winamp (WM_USER and WM_COMMAND). MM partially emulates how WinAmp works (not 100%, but very close) and so it can use WinAmp plug-ins. The class name to communicate with is &amp;quot;Winamp v1.x&amp;quot;.&lt;br /&gt;
*Using OLE Automation, which can be very easily used e.g. from VB Script.&lt;br /&gt;
*:&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;Dim SDB : Set SDB = CreateObject(&amp;quot;SongsDB.SDBApplication&amp;quot;)&amp;lt;/source&amp;gt;&lt;br /&gt;
*:&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;SongsDB.SDBApplicationClass SDB = new SongsDB.SDBApplicationClass();&amp;lt;/source&amp;gt;&lt;br /&gt;
*:Be sure to set &#039;&#039;SDB.ShutdownAfterDisconnect&#039;&#039; to &#039;&#039;False&#039;&#039; if you opened the MediaMonkey program by calling the SDB object, and you don&#039;t want it to be closed when your external program exits (or if you disconnect the SDB object = COM link).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Helpful sites:&#039;&#039;&#039;&lt;br /&gt;
*http://www.microsoft.com/scripting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Handy editors:&#039;&#039;&#039;&lt;br /&gt;
*[http://www.vbsedit.com/ VBSEdit]&lt;br /&gt;
*[http://notepad-plus.sourceforge.net/ NotePad++]&lt;br /&gt;
*[http://www.pspad.com/ PSPad]&lt;br /&gt;
*[http://www.sapien.com/ PrimalScript]&lt;br /&gt;
*[http://www.microsoft.com/downloads/details.aspx?familyid=2f465be0-94fd-4569-b3c4-dffdf19ccd99&amp;amp;displaylang=en Microsoft VBScript 5.6 Debugger for Win 2000/XP]&lt;br /&gt;
*[http://www.editpadpro.com/ EditPad (Pro)]&lt;br /&gt;
&lt;br /&gt;
==Visual Basic Script==&lt;br /&gt;
&lt;br /&gt;
Usually indexes start from &#039;&#039;&#039;0&#039;&#039;&#039; (e.g. for normal arrays). However, sometimes (e.g. for string positions) they start from &#039;&#039;&#039;1&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Helpful sites:&#039;&#039;&#039;&lt;br /&gt;
*[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/0a8270d7-7d8f-4368-b2a7-065acb52fc54.asp User guide and language reference]&lt;br /&gt;
*[http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true Script Center Repository]&lt;br /&gt;
*[http://www.w3schools.com/vbscript/default.asp W3Schools VBScript]&lt;br /&gt;
&lt;br /&gt;
==Database transactions==&lt;br /&gt;
&lt;br /&gt;
Starting from MM 3.0 transactions are often used when working with database. It can cause some problems to script authors in case they don&#039;t know some details. One example where you can face a problem is when you use [[ISDBSongData::UpdateDB]] method while you have some SQL query open. What happens in this case is, that MM wants to start a transaction, but there&#039;s still an SQL query open. This results either in an error message (in debug build) or possibly an apparent freeze of MM in the release build.&lt;br /&gt;
&lt;br /&gt;
In order to prevent this problem, you can either:&lt;br /&gt;
* Put all these DB operations in an transaction, i.e. use [[ISDBDatabase::BeginTransaction]] and [[ISDBDatabase::Commit]].&lt;br /&gt;
* Close already running SQL queries before you call things like [[ISDBSongData::UpdateDB]].&lt;br /&gt;
&lt;br /&gt;
==SQL==&lt;br /&gt;
&lt;br /&gt;
To easily create complex SQL queries, you can use the Query graphical user interface in Access interface, and show the SQL code when you are done.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One of the problems with SQL is that dates are often confused, which sometimes give programming bugs. The best way to circumvent this problem is by using the format #yyyy-mm-dd# for all dates in SQL (e.g. #2006-10-31# for 31th October 2006).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Helpful sites:&#039;&#039;&#039;&lt;br /&gt;
*[http://www.w3schools.com/sql/default.asp W3Schools SQL]&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=ISDBUIButton::UseScript&amp;diff=2838</id>
		<title>ISDBUIButton::UseScript</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=ISDBUIButton::UseScript&amp;diff=2838"/>
		<updated>2007-10-07T01:58:28Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: Supplanted by ISDBScriptControl::RegisterEvent&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MethodDeclaration|SDBUIButton|ISDBUIButton|Property Get/Let UseScript As String}}&lt;br /&gt;
&lt;br /&gt;
===Property description===&lt;br /&gt;
&lt;br /&gt;
Filename of a script where event functions are located.&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
&lt;br /&gt;
This property has been supplanted by the [[ISDBScriptControl::RegisterEvent]] method.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Automation objects|{{PAGENAME}}]]&lt;br /&gt;
[[Category:CoClass SDBUIButton|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Interface ISDBUIButton|{{PAGENAME}}]]&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=ISDBMenuItem::OnClickFunc&amp;diff=2837</id>
		<title>ISDBMenuItem::OnClickFunc</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=ISDBMenuItem::OnClickFunc&amp;diff=2837"/>
		<updated>2007-10-07T01:57:37Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: Supplanted by ISDBScriptControl::RegisterEvent&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MethodDeclaration|SDBMenuItem|ISDBMenuItem|Property Get/Let OnClickFunc As String}}&lt;br /&gt;
&lt;br /&gt;
===Property description===&lt;br /&gt;
&lt;br /&gt;
Name of the function that is called when the item is clicked. The function is expected to be in &#039;UseScript&#039; file. There is one parameter passed to the function - this menu item ([[SDBMenuItem]] object).&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
&lt;br /&gt;
This property has been supplanted by the [[ISDBScriptControl::RegisterEvent]] method.&lt;br /&gt;
&lt;br /&gt;
===Example code===                    &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
&#039;The function to be called can look like:&lt;br /&gt;
&lt;br /&gt;
Sub OnMenuItemClick( Item)&lt;br /&gt;
  &#039; Some code here&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Automation objects|{{PAGENAME}}]]&lt;br /&gt;
[[Category:CoClass SDBMenuItem|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Interface ISDBMenuItem|{{PAGENAME}}]]&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=ISDBUIButton::OnClickFunc&amp;diff=2836</id>
		<title>ISDBUIButton::OnClickFunc</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=ISDBUIButton::OnClickFunc&amp;diff=2836"/>
		<updated>2007-10-07T01:57:11Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: Supplanted by ISDBScriptControl::RegisterEvent&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MethodDeclaration|SDBUIButton|ISDBUIButton|Property Get/Let OnClickFunc As String}}&lt;br /&gt;
&lt;br /&gt;
===Property description===&lt;br /&gt;
&lt;br /&gt;
Name of the function that is called when the button is clicked. The function is expected to be in [[ISDBUIButton::UseScript]] file. There is one parameter passed to the function - this button ([[SDBUIButton]] object).&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
&lt;br /&gt;
This property has been supplanted by the [[ISDBScriptControl::RegisterEvent]] method.&lt;br /&gt;
&lt;br /&gt;
===Example code===                    &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
&#039;The function to be called can look like:&lt;br /&gt;
&lt;br /&gt;
Sub OnbuttonClick( Btn)&lt;br /&gt;
  &#039; Some code here&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Automation objects|{{PAGENAME}}]]&lt;br /&gt;
[[Category:CoClass SDBUIButton|{{PAGENAME}}]]&lt;br /&gt;
[[Category:Interface ISDBUIButton|{{PAGENAME}}]]&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=Scripting_Tips_%26_Tricks_(MM4)&amp;diff=2835</id>
		<title>Scripting Tips &amp; Tricks (MM4)</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=Scripting_Tips_%26_Tricks_(MM4)&amp;diff=2835"/>
		<updated>2007-10-06T17:19:00Z</updated>

		<summary type="html">&lt;p&gt;Imd1b4u: Removed DebugView and WSHHelper. ~~~~&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==(MediaMonkey) Scripting in general==&lt;br /&gt;
&lt;br /&gt;
Using the SongData object, you can either update the database/library (UpdateDB) and/or update the file&#039;s tags (WriteTags). So there&#039;s no way to let the song changes be saved like the user selected in the Options panel (menu Tools &amp;gt; Options &amp;gt; Library &amp;gt; Tags &amp;amp; Playlists &amp;gt; &amp;quot;Update tags when editing properties&amp;quot;).&lt;br /&gt;
However, the UpdateAll method for the SongList object &#039;&#039;does&#039;&#039; take into account this user-specified option. So you can create a new SongList object using SDB.NewSongList and add your SDBSongData object(s) to it. Then call the UpdateAll method on the songlist, and your song(s) will be saved in user-specified way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MS Visual Studio contains a tool called [http://www.microsoft.com/downloads/details.aspx?familyid=5233B70D-D9B2-4CB5-AEB6-45664BE858B6&amp;amp;displaylang=en OLEView] (&amp;quot;OLE Viewer&amp;quot; or &amp;quot;OLE/COM Object Viewer&amp;quot;) ([http://download.microsoft.com/download/win2000platform/oleview/1.00.0.1/nt5/en-us/oleview_setup.exe direct link]), which can show the type library of the SongsDB object: &amp;quot;MediaMonkey Library&amp;quot;. There, you can see all supported properties and methods of the MediaMonkey scripting interface. This can be handy to find out new scripting methods while the scripting help isn&#039;t up-to-date yet.&lt;br /&gt;
&amp;lt;br&amp;gt;The way to get there: &#039;&#039;OleView&#039;&#039; &amp;gt; Type Libraries &amp;gt; MediaMonkey Library &amp;gt; (double click)&lt;br /&gt;
&amp;lt;br&amp;gt;and then in the &#039;&#039;ITypeLib Viewer&#039;&#039; &amp;gt; SongsDB (MediaMonkey Library) &amp;gt; Interfaces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you un(dock) a dockable panel, the OnResize event is triggered twice:&lt;br /&gt;
*Once while the panel is being (un)docked with DockedTo = 0&lt;br /&gt;
*Once after the panel has been (undocked): with DockedTo = -1 (panel undocked) or DockedTo = X (panel docked, X is the number that represents the docking position)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A dockable panel always has to be added to the SDB.Objects dictionary. If you don&#039;t add it, it will be gone immediately after you created it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are still 2 scripting mechanisms available:&lt;br /&gt;
*Using the (mostly deprecated) &#039;&#039;old event mechanism&#039;&#039; (using &#039;&#039;Control&#039;&#039;.OnClickFunc and &#039;&#039;Control&#039;&#039;.UseScript), your global variables aren&#039;t remembered in the event handlers (e.g. kind of like the script is reopened). For those scripts, you had to use &#039;&#039;ParentControl&#039;&#039;.ChildControl(&amp;quot;control name&amp;quot;) or save object references to SDB&#039;s &#039;&#039;Objects&#039;&#039; dictionary.&lt;br /&gt;
*Using the &#039;&#039;new event mechanism&#039;&#039;, your global variables &#039;&#039;are&#039;&#039; remembered so you can use their values in the event handlers. The Objects dictionary is now only necessary to communicate/store object references between different scripts.&lt;br /&gt;
==&amp;gt; So always use the new event mechanism where you can. Only for option panels (sheets) this is not yet possible. There you&#039;ll need to store values between the main program and the event handlers in SDB.Objects, in the INI or in the Registry.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Changing the selected node from a script (using SDB.MainTree.CurrentNode = ...........) takes some time to happen, and it happens asynchronicly (the code execution doesn&#039;t wait until the node is really selected). For that reason, you can&#039;t use (get value of) SDB.MainTree.CurrentNode directly after you have assigned a new node to it (set value to), because changes won&#039;t have happened yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are at least three ways to interact with MediaMonkey from an external program:&lt;br /&gt;
*Open the MediaMonkey.exe program with command line options (arguments).&lt;br /&gt;
*Using the same Windows Messages (SendMessage/PostMessage) as in Winamp (WM_USER and WM_COMMAND). MM partially emulates how WinAmp works (not 100%, but very close) and so it can use WinAmp plug-ins. The class name to communicate with is &amp;quot;Winamp v1.x&amp;quot;.&lt;br /&gt;
*Using OLE Automation, which can be very easily used e.g. from VB Script.&lt;br /&gt;
*:&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;Dim SDB : Set SDB = CreateObject(&amp;quot;SongsDB.SDBApplication&amp;quot;)&amp;lt;/source&amp;gt;&lt;br /&gt;
*:&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;SongsDB.SDBApplicationClass SDB = new SongsDB.SDBApplicationClass();&amp;lt;/source&amp;gt;&lt;br /&gt;
*:Be sure to set &#039;&#039;SDB.ShutdownAfterDisconnect&#039;&#039; to &#039;&#039;False&#039;&#039; if you opened the MediaMonkey program by calling the SDB object, and you don&#039;t want it to be closed when your external program exits (or if you disconnect the SDB object = COM link).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Helpful sites:&#039;&#039;&#039;&lt;br /&gt;
*http://www.microsoft.com/scripting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Handy editors:&#039;&#039;&#039;&lt;br /&gt;
*[http://www.vbsedit.com/ VBSEdit]&lt;br /&gt;
*[http://notepad-plus.sourceforge.net/ NotePad++]&lt;br /&gt;
*[http://www.pspad.com/ PSPad]&lt;br /&gt;
*[http://www.sapien.com/ PrimalScript]&lt;br /&gt;
*[http://www.microsoft.com/downloads/details.aspx?familyid=2f465be0-94fd-4569-b3c4-dffdf19ccd99&amp;amp;displaylang=en Microsoft VBScript 5.6 Debugger for Win 2000/XP]&lt;br /&gt;
*[http://www.editpadpro.com/ EditPad (Pro)]&lt;br /&gt;
&lt;br /&gt;
==Visual Basic Script==&lt;br /&gt;
&lt;br /&gt;
Usually indexes start from &#039;&#039;&#039;0&#039;&#039;&#039; (e.g. for normal arrays). However, sometimes (e.g. for string positions) they start from &#039;&#039;&#039;1&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Helpful sites:&#039;&#039;&#039;&lt;br /&gt;
*[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/0a8270d7-7d8f-4368-b2a7-065acb52fc54.asp User guide and language reference]&lt;br /&gt;
*[http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true Script Center Repository]&lt;br /&gt;
*[http://www.w3schools.com/vbscript/default.asp W3Schools VBScript]&lt;br /&gt;
&lt;br /&gt;
==Database transactions==&lt;br /&gt;
&lt;br /&gt;
Starting from MM 3.0 transactions are often used when working with database. It can cause some problems to script authors in case they don&#039;t know some details. One example where you can face a problem is when you use [[ISDBSongData::UpdateDB]] method while you have some SQL query open. What happens in this case is, that MM wants to start a transaction, but there&#039;s still an SQL query open. This results either in an error message (in debug build) or possibly an apparent freeze of MM in the release build.&lt;br /&gt;
&lt;br /&gt;
In order to prevent this problem, you can either:&lt;br /&gt;
* Put all these DB operations in an transaction, i.e. use [[ISDBDatabase::BeginTransaction]] and [[ISDBDatabase::Commit]].&lt;br /&gt;
* Close already running SQL queries before you call things like [[ISDBSongData::UpdateDB]].&lt;br /&gt;
&lt;br /&gt;
==SQL==&lt;br /&gt;
&lt;br /&gt;
To easily create complex SQL queries, you can use the Query graphical user interface in Access interface, and show the SQL code when you are done.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One of the problems with SQL is that dates are often confused, which sometimes give programming bugs. The best way to circumvent this problem is by using the format #yyyy-mm-dd# for all dates in SQL (e.g. #2006-10-31# for 31th October 2006).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Helpful sites:&#039;&#039;&#039;&lt;br /&gt;
*[http://www.w3schools.com/sql/default.asp W3Schools SQL]&lt;/div&gt;</summary>
		<author><name>Imd1b4u</name></author>
	</entry>
</feed>