by Eyal » Sun Jan 30, 2011 4:18 am
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\"
Hi,
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
I think
{app}\ should install in application folder. {usr}\ or another variable name might be used to install into local folder.
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 :~)
[quote="jiri"]I added a small Wiki section that describes changes that might be needed for some scripts, it's here:
[u]Making scripts ready for per-user installations[/u]
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\"[/quote]
Hi,
[b]I finally found why I had hard time debugging my new script under MM4![/b]
- I'm running Windows XP, MM 3.2.4.
- I upgrade MM3 by installing MM4 in same folder. The folder already contained scripts in [color=#4000FF]\Program Files\Mediamonkey\Scripts\Auto[/color],
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 (?)
[u]Reason[/u]: New mmip installation put the script in [color=#4000FF]C:\Documents and Settings\Eyal\Application Data\MediaMonkey\Scripts\Auto[/color], instead of overwriting the old one. So after restarting MM, 2 versions of the script are running simultaneously.
Here's the mmip:
[code][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[/code]
I think [color=#FF0000][b]{app}\[/b][/color] should install in application folder. {usr}\ or another variable name might be used to install into local folder.
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 :~)