New scripting features in MM 2.5.2
KK, plz this has become really annoying...
Jiri, after several unsuccesfull attempts to register "OnPlay", "OnShutdown" and all the other events I copied the code you provided inside a test.vbs autoscript.
None of the registered events works except the timer.
In other words i get a msgbox every 10 sec but i cant get any other msgbox no matter how many times i start palyback, pause it, stop it, exit MM or update track properties...
WHAT IS THE PROBLEM???????
Jiri, after several unsuccesfull attempts to register "OnPlay", "OnShutdown" and all the other events I copied the code you provided inside a test.vbs autoscript.
None of the registered events works except the timer.
In other words i get a msgbox every 10 sec but i cant get any other msgbox no matter how many times i start palyback, pause it, stop it, exit MM or update track properties...
WHAT IS THE PROBLEM???????
I've got an OnTrackProperties event working fine, plus multiple OnTimer events. So far I've continued using scripttype=2 instead of OnPlay events though.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
here is the code...
I am using latest beta....
I put is as test.vbs inside auto folder....
Only thing i can suspect is IE7 (which i have installed 2 months ago)....
EDIT:
Would a debug log help??
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( 10000) ' 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( Timer)
SDB.MessageBox "10 seconds elapsed!", mtInformation, Array(mbOk)
Script.UnregisterEvents Timer ' Terminate usage of this timer
End Sub
I put is as test.vbs inside auto folder....
Only thing i can suspect is IE7 (which i have installed 2 months ago)....
EDIT:
Would a debug log help??
All of those work for me, and I'm using IE6 (well, Firefox 1.5 actually!) so maybe that is the problem.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Although the OnTrackProperties event works for me, I think it is very limited. At the moment it is only triggered when you are using the properties window. What about tagging from Amazon or from scripts? The message appears at the bottom: "# tracks to be tagged", so MM must know the properties have been changed. Surely the event should be triggered in these cases too?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Jiri
After doing a clean install, all the events worked as they should. Seems like that all thoses updates with betas somehow "corrupted" the installation.
Anyway, i will start installing all my scripts one by one and if i discover that the problem was created by a script i will post it here for future reference.
Thanks again...
After doing a clean install, all the events worked as they should. Seems like that all thoses updates with betas somehow "corrupted" the installation.
Anyway, i will start installing all my scripts one by one and if i discover that the problem was created by a script i will post it here for future reference.
Thanks again...
Just discovered that the clean install was not necessary after all...
Seems like MMEvents can only be hooked by one Script.
To prove that i will described the procedure to replicate the problem.
After doing a clean install, first thing i did is created a test.vbs file and put it in the auto folder...
The code i used for this file was
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
After that i install the StartupNode.vbs script, again inside the auto folder. I used the code from this topic.
I restarted MM. Both timers (from the 2 scripts) ran normally, but the other events from the test.vbs were not registered.
But the OnShutdown event was registered OK for Startupnode.vbs
I changed the filename for test.vbs to atest.vbs to force MM load it first.
Now, all events for atest.vbs were working, but only the timer was working for the Startupnode.vbs
I hope this will be fixed soon because those events are really useful and cant be blocked by only one script...
Don't worry, it happens to the best of us! 
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Double Events behaviour
I have recognised that if i have two scripts in the auto folder which both call a Onshutdown Event only the first one (in alphebetical order) will be started on programm exit.
Huh hummmmm...: http://www.mediamonkey.com/forum/viewto ... 4194#44194 (previous page of this thread)
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
-
DiddeLeeDoo
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
Although it maybe another silly one from me, I thought it was a bit interesting that when Roving Cowboy tested that very first version of AutoRating, he had conflicts with some other scripts.
I though simple, and changed every variable to unique name, and sent him this version, and he said it fixed the problem.
Basically the experience was 'keep it unique'... I'm not into events yet, but this factor that maybe should not be a factor, may actually be one.
I though simple, and changed every variable to unique name, and sent him this version, and he said it fixed the problem.
Basically the experience was 'keep it unique'... I'm not into events yet, but this factor that maybe should not be a factor, may actually be one.
-
rovingcowboy
- Posts: 14163
- Joined: Sat Oct 25, 2003 7:57 am
- Location: (Texas)
- Contact:
the first coder i ever got help from for another program about 10 years ago told me his codes were always workable becuase he used his own wording.
at the time i did not know what he meant. but since i am starting to know a little more about coding i believe he was saying what diddeleedoo just said. keep it unique to that one code / script.
which makes me think that the windows scripting host engine is seeing one thing in a script as already running. so it does not start it again.
that is what i think is going on and just wanted to confirm / support,
diddeleedoo on what he said.

at the time i did not know what he meant. but since i am starting to know a little more about coding i believe he was saying what diddeleedoo just said. keep it unique to that one code / script.
which makes me think that the windows scripting host engine is seeing one thing in a script as already running. so it does not start it again.
that is what i think is going on and just wanted to confirm / support,
diddeleedoo on what he said.
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy A51 5G Android ) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
