Porting scripts for MM 4.0
Moderators: Gurus, Addon Administrators
Porting scripts for MM 4.0
I added a small Wiki section that describes changes that might be needed for some scripts, it's here: http://www.mediamonkey.com/wiki/index.p ... tallations
Feel free to post more examples/tips, in case you find some.
Thanks,
Jiri
Feel free to post more examples/tips, in case you find some.
Thanks,
Jiri
Re: Porting scripts for MM 4.0
Well, it is not enough to change only that. Here are some differences which I have discovered that could stop executing some scripts:
1. When track finish with reproduction with MM 3.x we had OnTrackProperties event , then OnTrackEnd, then OnPlaybackEnd; with 4.0 we have OnTrackEnd, then OnPlaybackEnd, then OnTrackProperties instead;
2. If you set SDBSongData.PlayCounter = 0, with MM3 SDBSongData.LastPlayed stays unchanged, but with MM4 it is set to 0 as well;
3. Setting SDB.MainTree.Node_XXX.Expanded = True/False not works anymore (this is obviously a bug and I hope it would be resolved as soon as possible since several of my scripts are using that);
4. Error because VarType(SDBSongData.FileLength) = 20 while it should be = 3 as before (one more bug);
5. some Web Browser controls are not displayed at all (Magic Nodes and RegExp scripts are affected); I am trying to find some solution, but I am afraid that this could be resolved only in the program itself.
1. When track finish with reproduction with MM 3.x we had OnTrackProperties event , then OnTrackEnd, then OnPlaybackEnd; with 4.0 we have OnTrackEnd, then OnPlaybackEnd, then OnTrackProperties instead;
2. If you set SDBSongData.PlayCounter = 0, with MM3 SDBSongData.LastPlayed stays unchanged, but with MM4 it is set to 0 as well;
3. Setting SDB.MainTree.Node_XXX.Expanded = True/False not works anymore (this is obviously a bug and I hope it would be resolved as soon as possible since several of my scripts are using that);
4. Error because VarType(SDBSongData.FileLength) = 20 while it should be = 3 as before (one more bug);
5. some Web Browser controls are not displayed at all (Magic Nodes and RegExp scripts are affected); I am trying to find some solution, but I am afraid that this could be resolved only in the program itself.
● Magic Nodes 4.3.3 / 5.2 ● RegExp Find & Replace 4.4.9 / 5.2 ● Invert Selection/Select None 1.5.1 ● Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1 ● Expand Child Nodes/Expand All 1.1.2 ● Event Logger 2.7 ● Filtered Statistics Report 1.6 ● Track Redirection & Synchronization 3.4.2 ● Restore/Synchronize Database 3.1.8 / 4.0.1 ● Find Currently Playing Track 1.3.2 ● Queue List 1.2.1 ● Add to Library on Play 1.0.1 ● Tree Report for Child Nodes 1.1.1 ● Update Location of Files in Database 1.4.5 / 2.3 ● Inherit Child Playlists 1.0.3 ● Add Currently Playing/Selected Track(s) to Playlist 1.2
Re: Porting scripts for MM 4.0
re 1. tracked and tested within http://www.ventismedia.com/mantis/view.php?id=7084
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
How to attach PICTURE/SCREENSHOTS to forum posts
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
How to attach PICTURE/SCREENSHOTS to forum posts
Re: Porting scripts for MM 4.0
I am sorry, but your description in that report was not very clear to me. Beside of that, you are mentioning only change of PlayCount, but forgot to mention LastPlayed. And why you put that issue in Last.fm plugin Project when it could have some side effect with any script?Peke wrote:re 1. tracked and tested within http://www.ventismedia.com/mantis/view.php?id=7084
● Magic Nodes 4.3.3 / 5.2 ● RegExp Find & Replace 4.4.9 / 5.2 ● Invert Selection/Select None 1.5.1 ● Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1 ● Expand Child Nodes/Expand All 1.1.2 ● Event Logger 2.7 ● Filtered Statistics Report 1.6 ● Track Redirection & Synchronization 3.4.2 ● Restore/Synchronize Database 3.1.8 / 4.0.1 ● Find Currently Playing Track 1.3.2 ● Queue List 1.2.1 ● Add to Library on Play 1.0.1 ● Tree Report for Child Nodes 1.1.1 ● Update Location of Files in Database 1.4.5 / 2.3 ● Inherit Child Playlists 1.0.3 ● Add Currently Playing/Selected Track(s) to Playlist 1.2
Re: Porting scripts for MM 4.0
I have found a reason for that and reported in Mantis: Second Web Browser control on form has serious problem with Common.Anchors property [4.x]ZvezdanD wrote:5. some Web Browser controls are not displayed at all (Magic Nodes and RegExp scripts are affected); I am trying to find some solution, but I am afraid that this could be resolved only in the program itself.
● Magic Nodes 4.3.3 / 5.2 ● RegExp Find & Replace 4.4.9 / 5.2 ● Invert Selection/Select None 1.5.1 ● Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1 ● Expand Child Nodes/Expand All 1.1.2 ● Event Logger 2.7 ● Filtered Statistics Report 1.6 ● Track Redirection & Synchronization 3.4.2 ● Restore/Synchronize Database 3.1.8 / 4.0.1 ● Find Currently Playing Track 1.3.2 ● Queue List 1.2.1 ● Add to Library on Play 1.0.1 ● Tree Report for Child Nodes 1.1.1 ● Update Location of Files in Database 1.4.5 / 2.3 ● Inherit Child Playlists 1.0.3 ● Add Currently Playing/Selected Track(s) to Playlist 1.2
Re: Porting scripts for MM 4.0
Hi,jiri wrote:I added a small Wiki section that describes changes that might be needed for some scripts, it's here:
Making scripts ready for per-user installations
Starting from MediaMonkey 4.0, scripts can be (and are suggested to be) installed per-user, and so they don't have to be installed in Program Files folder, but are installed in local Windows folders. The mechanism in MM is internally make as transparent as possible, so that scripts don't have to care much about their installed location. That said, some pre-4.0 scripts might need tweaking. For example, a popular script Lyricator has >1000 lines, but there's only one change needed in order to get it working under local installation, namely:
Dim sAppPath: sAppPath = sdb.ApplicationPath & "Scripts\Lyricator\"needs to be changed to
Dim sAppPath: sAppPath = sdb.ScriptsPath & "Lyricator\"
I finally found why I had hard time debugging my new script under MM4!
- I'm running Windows XP, MM 3.2.4.
- I upgrade MM3 by installing MM4 in same folder. The folder already contained scripts in \Program Files\Mediamonkey\Scripts\Auto,
with my new script in it. So far so good. The script is working.
- I made some changes to my script, rebuilt the mmip and install it. The script now seems to run twice (?)
Reason: New mmip installation put the script in C:\Documents and Settings\Eyal\Application Data\MediaMonkey\Scripts\Auto, instead of overwriting the old one. So after restarting MM, 2 versions of the script are running simultaneously.
Here's the mmip:
Code: Select all
[Header]
ID=PlayedDateAndCounter
Title=Played Date & Counter
Description=Sets Played Date and Counter on playback startup
VersionMajor=1
VersionMinor=0
Type=Script
[Copy]
Src=PlayedDateAndCounter.vbs
Tgt={app}\Scripts\Auto\PlayedDateAndCounter.vbs
[Execute]
File={app}\Scripts\Auto\PlayedDateAndCounter.vbs
Function=OnStartup
Is that what you meant by "The mechanism in MM is internally make as transparent as possible, so that scripts don't have to care much about their installed location." ?
Thanks
Eyal :~)
-
- Posts: 14163
- Joined: Sat Oct 25, 2003 7:57 am
- Location: (Texas)
- Contact:
Re: Porting scripts for MM 4.0
Eyal wrote:Hi,jiri wrote:I added a small Wiki section that describes changes that might be needed for some scripts, it's here:
Making scripts ready for per-user installations
Starting from MediaMonkey 4.0, scripts can be (and are suggested to be) installed per-user, and so they don't have to be installed in Program Files folder, but are installed in local Windows folders. The mechanism in MM is internally make as transparent as possible, so that scripts don't have to care much about their installed location. That said, some pre-4.0 scripts might need tweaking. For example, a popular script Lyricator has >1000 lines, but there's only one change needed in order to get it working under local installation, namely:
Dim sAppPath: sAppPath = sdb.ApplicationPath & "Scripts\Lyricator\"needs to be changed to
Dim sAppPath: sAppPath = sdb.ScriptsPath & "Lyricator\"
I finally found why I had hard time debugging my new script under MM4!
- I'm running Windows XP, MM 3.2.4.
- I upgrade MM3 by installing MM4 in same folder. The folder already contained scripts in \Program Files\Mediamonkey\Scripts\Auto,
with my new script in it. So far so good. The scripts is working.
- I made some changes to my script, rebuilt the mmip and install it. The script now seems to run twice (?)
Reason: New mmip installation put the script in C:\Documents and Settings\Eyal\Application Data\MediaMonkey\Scripts\Auto, instead of overwriting the old one. So after restarting MM, 2 versions of the script are running simultaneously.
Here's the mmip:I think {app}\ should install in application folder. {usr}\ or another variable name might be used to install local folder.Code: Select all
[Header] ID=PlayedDateAndCounter Title=Played Date & Counter Description=Sets Played Date and Counter on playback startup VersionMajor=1 VersionMinor=0 Type=Script [Copy] Src=PlayedDateAndCounter.vbs Tgt={app}\Scripts\Auto\PlayedDateAndCounter.vbs [Execute] File={app}\Scripts\Auto\PlayedDateAndCounter.vbs Function=OnStartup
Is that what you meant by "The mechanism in MM is internally make as transparent as possible, so that scripts don't have to care much about their installed location." ?
Thanks
Eyal :~)
hey eyal for my skin mmip i just tried to get updated it put the skin name in the skins choice window twice you might have found the answer for me i'll look in that other place on mine for the extra skin.
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.
Re: Porting scripts for MM 4.0
I don't think so. If you introduce something like that, none existing installer package would be compatible with MM4. During installation of the new version of script/skin, the program itself should uninstall the old version of the same script/skin, not matter if it is previously installed in local or global folder and not matter of the current user choice of the installation folder.Eyal wrote:I think {app}\ should install in application folder. {usr}\ or another variable name might be used to install into local folder.
I am going to report that in Mantis: Uninstall of old version of scripts/skins during installation of new version doesn't work always.
● Magic Nodes 4.3.3 / 5.2 ● RegExp Find & Replace 4.4.9 / 5.2 ● Invert Selection/Select None 1.5.1 ● Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1 ● Expand Child Nodes/Expand All 1.1.2 ● Event Logger 2.7 ● Filtered Statistics Report 1.6 ● Track Redirection & Synchronization 3.4.2 ● Restore/Synchronize Database 3.1.8 / 4.0.1 ● Find Currently Playing Track 1.3.2 ● Queue List 1.2.1 ● Add to Library on Play 1.0.1 ● Tree Report for Child Nodes 1.1.1 ● Update Location of Files in Database 1.4.5 / 2.3 ● Inherit Child Playlists 1.0.3 ● Add Currently Playing/Selected Track(s) to Playlist 1.2
Re: Porting scripts for MM 4.0
Thanks, fixed as http://www.ventismedia.com/mantis/view.php?id=7273Eyal wrote: - I'm running Windows XP, MM 3.2.4.
- I upgrade MM3 by installing MM4 in same folder. The folder already contained scripts in \Program Files\Mediamonkey\Scripts\Auto,
with my new script in it. So far so good. The script is working.
- I made some changes to my script, rebuilt the mmip and install it. The script now seems to run twice (?)
Re: Porting scripts for MM 4.0
Thank you.
Re: Porting scripts for MM 4.0
In terms of creating files to be used by the script, is it better to use Script.ScriptPath or %appdata%\mediamonkey?
I just went and re-wrote my script to use %appdata% to now discover MM4 can install scripts to %appdata% now.
Given I would prefer it to be compatible with MM3 & 4, I'm thinking using %appdata% is the best option for now...
I just went and re-wrote my script to use %appdata% to now discover MM4 can install scripts to %appdata% now.
Given I would prefer it to be compatible with MM3 & 4, I'm thinking using %appdata% is the best option for now...