1) An "OnTracksSynced" or similar event which allows you to run code after a sync.
2) Scripting access to the sleep function so it can be triggered programatically.
N.B. By "sleep function" I mean the MM one, not the VBScript one!
Yeah, i had seen this topic, but Jiri mentioned that it will be fixed in 2.3 and so i thought that 2.3.954 was OK.Steegy wrote:Huh hummmmm...: http://www.mediamonkey.com/forum/viewto ... 4194#44194 (previous page of this thread)
Code: Select all
Sub OnStartup
Script.RegisterEvent SDB, "OnShutdown", "SDBShutdown"
Script.RegisterEvent SDB, "OnTrackProperties", "SDBTrackProperties"
Script.RegisterEvent SDB, "OnPlay", "SDBPlay"
Script.RegisterEvent SDB, "OnPause", "SDBPause"
Set Tmr = SDB.CreateTimer( 1000) ' Pop up a message in 10 seconds
Script.RegisterEvent Tmr, "OnTimer", "TestTimer"
End Sub
Sub SDBTrackProperties( tracks)
SDB.MessageBox "Wow, track properties were modified for "&tracks.count&" track(s)!", mtInformation, Array(mbOk)
' Script.UnregisterEvents SDB
End Sub
Sub SDBShutdown
SDB.MessageBox "MediaMonkey is finishing... :(", mtInformation, Array(mbOk)
End Sub
Sub SDBPlay
SDB.MessageBox "Started playback of "&SDB.Player.CurrentSong.ArtistName&_
" - "&SDB.Player.CurrentSong.Title, mtInformation, Array(mbOk)
End Sub
Sub SDBPause
If SDB.Player.isPaused then
SDB.MessageBox "Playback paused", mtInformation, Array(mbOk)
End If
End Sub
Sub TestTimer(Tmr)
Script.UnregisterEvents Tmr ' Terminate usage of this Timer
SDB.MessageBox "10 seconds elapsed!", mtInformation, Array(mbOk)
End Sub
This is indeed a bug and will be fixed. Thanks.Ok, upon MM restart a timer pop up should come up...
Start playback, a pop up should come up. Modify any track except the one playing, a pop up should come up.
Modify the current playing track... a pop up should come up followed by 2 or 3 error messages "Error executing script event"....
I'd like to better inform about scripting changes in the future versions. Possibly a special thread here would be good for this.Is it possible to add also script related changes to the "Changes / What's new" list with new releases?
Will this work after the "event-can-only-have-one-handler" problem has been fixed? Or does it already work?Scripting Functionality Wishlist wrote:Events should also work with built-in tree nodes, or there should be some other way of making the tree context menu adaptable to the tree node that is right-clicked (e.g. show additional context menu items for certain nodes)
Code: Select all
DoneSoFar = 0
For i = 0 to ToDoList.Count-1
If Idle then
ToDoList.Task(i)
DoneSoFar = DoneSoFar + 1
Else
Exit For
End If
Next
ToDoList = ToDoList - DoneSoFar
Please empty the artist name (and best of all any field you expect to be filled in) before the function is called (i.e. track.ArtistName="").@Jiri
SDB.SongData.ParseText(...) doesn't work for the Artist, correct?
In the MainTracksWindows it is shown correctly after Parsing, but after refreshing, the Artist appeares untouched. For Title, ... it works well, thanks.
See http://www.mediamonkey.com/forum/viewto ... 6552#46552

Code: Select all
Script.RegisterEvent ListView.Interf, "ItemClick", "OnArtistSelect3"
Sub OnArtistSelect3(ListItem)
End Sub