New handling of script instances

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: New handling of script instances

Post by Teknojnky »

Bex wrote:1. It would only pop-up once per restart. Something like:

Code: Select all

Script "Vbs filename goes here" is in Developing Mode. If that is unexpected, Do Not use the script and please notify the script author!
But is there another way to alert the normal user that he is using a script that is in developing mode, if the developer misses to change the property?

2. Yes that was what I meant. E.g the developer just adds SDB.DevelopingMode=True in the top of the script to make it behave differently.
I don't see any need to notify the user at all.

But if the dev's feel such a restriction is necessary, then perhaps enable only MM debug releases (but still no pop-up notifications).

What if you had or were developing multiple scripts, can you imagine getting a bunch of pop up warnings every time you started MM? I would go insane and simply stop using/developing scripts.
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: New handling of script instances

Post by Bex »

I don't see any need to notify the user at all.
Well, since setting a script in devmode would prevent it from being ran as the latest script handling change has intended. it would make it a candidate to cause memory leaks etc.. Informing the user is therefore necessary. Otherwise is the latest script handling change possible to circumvent thus making it not to fix was it was intended to fix.
But if the dev's feel such a restriction is necessary, then perhaps enable only MM debug releases (but still no pop-up notifications)
Good idea. Another one could be to create strict developing version of MM. Which treats script the old way and has no pop-ups! :D
What if you had or were developing multiple scripts, can you imagine getting a bunch of pop up warnings every time you started MM? I would go insane and simply stop using/developing scripts.
The suggested change would almost eliminate the need for a restart so I really don't see this as a big problem!
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: New handling of script instances

Post by Teknojnky »

In my case, Still restarts due to script/programtic errors.
jiri
Posts: 5417
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Re: New handling of script instances

Post by jiri »

There will be SDBScriptControl::Reload method introduced in the next build. It should resolve your problems, you can either create a toolbar icon and force script reload whenever needed, or can call it in a timer, so that the script is periodically refreshed, or whatever else you might like.

Jiri
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: New handling of script instances

Post by Bex »

Great!
Thank you, Jiri! :D
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Re: New handling of script instances

Post by Teknojnky »

From wiki @ http://www.mediamonkey.com/wiki/index.p ... ol::Reload
Note that by calling this method you lose all global variables of the reloaded script, their content can't be preserved. On the other hand, all registered events are preserved.
Does this include related sdb.objects or just global variables within the script(s)?
jiri
Posts: 5417
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Re: New handling of script instances

Post by jiri »

Only the global variables, SDB.Objects persists whole MM session.

Jiri
Post Reply