See a new script SwitchFields http://www.mediamonkey.com/forum/viewtopic.php?t=7920
where I use this. (see imports section + it uses one function written at the end of the file)
This is only a "preview" what means that I wanted to share the idea and invite all scripters to add (and improve) functionality of these helper scripts. I suppose we'd better wait with using this concept extensively, until these helper files are "approved" and contain more useful things.
I think it would be the best if we all use the same helper scripts (e.g. "Utility_General.vbs" and "Utility_SQL.vbs", ...) instead of all having us own (e.g. "HelperScript_Psyxonova.vbs", "TrixmotoHelpers.vbs", "SteegyUtility.vbs", ...) what would cause a lot of problems, instead of making things better, imho.
I suppose this Script.Include method does the same thing of what I am doing in my SwitchFields script?
Actually, I had something in my mind so you could let MediaMonkey make references to helper methods.
E.g. if helper script "Utility_General.vbs" contains a function GetIniFile(), then you could use something like
Script.Use "Utility_General.vbs", "GetIniFile"
Then, everytime GetIniFile is used in the program, it would executed the referenced code in the "Utility_General.vbs" file. (instead of including the whole script file as it is now). That would work much faster.
It might even be better if we could use "Gen.GetIniFile" (where "Gen" indicated a class) so there would be less problems with
naming collisions and methods would be easier to recognise. (e.g. SQL.OpenDatabaseConnection("MyDB.mdb") )
Any way, with referenced scripts, it should also be possible for one referenced method to use another (not referenced) method in the same helper file.
This is probably much too difficult to create, but it would be very cool and would make helper scripts useful without extra overhead.
Anyway, thank you very much for responding so fast and to implement this first method! You really are helping scripting for MM a lot (with this, with added menu references, new events, ...)