I figured out the problem with previous versions of this script. New installer is available which should fix the problems we've experienced trying to run other scripts off of my right-click menus. The problem was with trying to use ScriptInclude in my script to be able to run the other ones. Variables and Constants in the other scripts were conflicting with each other. Now I avoid all that and everything appears to work well.
The new process is to:
1. Set '.UseScript' for each of the menus I create so that it refers to the other script.
2. Set '.OnClickFunc' for my new menu item to be "RightClickForScripts_" & the procedure name. (so for SqlViewer.vbs I use ".OnClickFunc = RightClickForScripts_SqlViewer"
3. The other scripts now need a new procedure in them that is called by mine. I iterate through each script to see if I've already added the code. If I haven't already added the code then...
4. The other script is copied to a backup with '.bak' extension (just in case)
5. I add a new procedure to the end of the other script that matches the one I specified above. This procedure calls the procedure in that script specified in the Scripts.ini file. So for SqlViewer.vbs I add a procedure that looks like this:
- Code: Select all
'Added by C:\Program Files\MediaMonkey\Scripts\Auto\RightClickForScripts.vbs
I've tested with various other scripts that previously failed or errored when trying to run and haven't had any problems (MM3 & vista). If you have a script that manually puts a menu item in Tools/Scripts, my script won't get those, as I'm only looking for entries in Scripts.Ini. I'm working on how to get those scripts into my right-click also (but that's proving to be a challenge to do automatically).
Version 1.4 Update April 5, 2008
-Fixed code to now add a snippet to other scripts to allow them to work off the right-click menus.
-Added code to hide the right-click menus if you uninstall from Tools/Extensions...
Download the installer
Good luck and thanks for trying it out!