Page 5 of 14

Posted: Thu Feb 28, 2008 9:12 am
by onenonymous
Almost for sure you've got the double quote missing at the end of the line. Trix also missed one after the ampersand in his suggestion. The line should be:

Code: Select all

sPath = sdb.ApplicationPath & "Scripts\Case.vbs"
I'm still looking into ways to avoid the need for this workaround -so if anyone has any suggestions, please let me know.

Posted: Thu Feb 28, 2008 9:25 am
by trixmoto
Haha! :oops: I've fixed mine now to avoid confusion!

Posted: Thu Feb 28, 2008 9:56 am
by nynaevelan
trixmoto wrote:Haha! :oops: I've fixed mine now to avoid confusion!
Ok, when you say you've fixed yours, do you mean you fixed your personal scripts on your machine, or are you saying you fixed the scripts that you've created and when they are released in the future adjustments will not be needed? I ask because I have a couple of yours which I needed to change.

Nyn

Posted: Thu Feb 28, 2008 2:26 pm
by trixmoto
No, I just mean I fixed the snippet of code which I posted above.

Posted: Thu Feb 28, 2008 3:01 pm
by nynaevelan
trixmoto wrote:No, I just mean I fixed the snippet of code which I posted above.
Ah Ha, I was hoping you were going to say you had a solution so that I wouldn't have to keep making all those changes. :(

Nyn

Posted: Fri Feb 29, 2008 3:49 am
by trixmoto
What changes?

Posted: Fri Feb 29, 2008 4:27 am
by spacefish
The changes we need to make to various scripts that won't run from the right-click menu otherwise. Apparently Nyn has quite a few that need editing. That's what I was trying to do earlier when you replied.

Posted: Fri Feb 29, 2008 4:54 am
by trixmoto
Well if someone wants to send me a PM telling me what scripts don't work I'll try to take a look and see what I can do.

Posted: Fri Feb 29, 2008 6:13 am
by nynaevelan
trixmoto wrote:Well if someone wants to send me a PM telling me what scripts don't work I'll try to take a look and see what I can do.
Sent :P

Nyn

Posted: Fri Feb 29, 2008 8:33 am
by trixmoto
I'll try to avoid using Script.ScriptPath wherever possible when updating my scripts and this should mean that more scripts will become compatible in the future. If people are struggling with particular scripts, make a post in that script's thread and I'll add it to my list.

Posted: Sat Mar 01, 2008 1:12 am
by spacefish
Okay, I guess I missed the last " when copying the text to paste into the script. It works now. Thank you. :)

Posted: Wed Mar 05, 2008 1:19 am
by MoDementia
I was just about to install this (and prob still will) but decided to read the comments first.

I vaguely remember a similar problem back in my scripting days and seem to recall that you can "execute" scripts rather than including them.

When I get some more time I'll try and find the code, I'm sure its in one of mine somewhere.

EDIT: Ah I see you have already changed it to execute Good.

There is something else I had to do because it doesn't quit your script while it runs the other, its coming back to me now :)

EDIT: Maybe I spoke too soon re first edit. Will have to install to check some code suggestions.

Posted: Wed Mar 05, 2008 3:08 am
by MoDementia
I didnt find what I thought I remembered but I did find this thread

http://www.mediamonkey.com/forum/viewtopic.php?t=4124

It may or may not be useful

Posted: Sat Mar 15, 2008 3:43 pm
by onenonymous
Updated code in the first post.

Version 1.2 Update March 15, 2008
-Cleaned up the code to run more efficiently
-Added button to the toolbar
-Added logging capability (click the toolbar button to use)
-Added ability to automatically fix scripts that failed off the right-click menu. Those scripts are first backed up with a '.bak' extension, then modified to work with the right-click menu. If you re-install a script that needed modification, you may need to re-start MM to get it to work off the right-click menu.
-Added code to create MM objects for each of the right-click menus. This way other scripters can access them from their scripts. This is explained below.

OPTIONAL FOR OTHER SCRIPTERS:
Other scripts can now access the right-click Scripts menus just as they would the MM built-in menus. This would be useful for scripts that load from Scripts/Auto folder and manually put a menu item into Tools/Scripts menus. There are five new menus available for you to use:
  • Menu_Pop_NP_MainWindow_Scripts
    Menu_Pop_TrackList_Scripts
    Menu_Pop_NP_Scripts
    Menu_Pop_Tree_Scripts
    Menu_TbStandard_Scripts
Here's an example on how to use it for the Scripts button in the toolbar. Simply copy the code below into the appropriate place in your script, then adjust the code as needed. You would do this for each of the 5 new script menus you wanted to put your menu into.

Code: Select all

	If SDB.Objects("Menu_TbStandard_Scripts") is Nothing Then
		Set objTBStandard_Scripts = sdb.UI.AddMenuItemSub(sdb.UI.Menu_TbStandard, -1, -1)
		Set SDB.Objects("Menu_TbStandard_Scripts") = objTBStandard_Scripts
	Else
		Set objTBStandard_Scripts = SDB.Objects("Menu_TbStandard_Scripts")
	End If
	
	Set objMenuItm = sdb.UI.AddMenuItem(objTBStandard_Scripts, -1, -1)
	objMenuItm.Caption = "Your Caption"
	objMenuItm.Hint = "This is the hint for your menu."
    Script.RegisterEvent objMenuItm, "OnClick", "YourProcedure" 

Posted: Sun Mar 16, 2008 2:20 am
by spacefish
I think your next update should include a .mmip installer. I'm lazy. :lol:

Thanks for the great script!