Right Click for Scripts -with buttons! (2008-09-07) [MM3]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

bob61
Posts: 157
Joined: Sun Dec 09, 2007 4:52 pm

Post by bob61 » Tue Feb 19, 2008 6:34 am

nynaevelan wrote:I understand your reluctance. However, as a test I installed a second copy of MM with only the scripts which come with it and I did not run into any errors, so the script has to be conflicting with something on your system. What other scripts do you have installed?

Nyn
Here's list of scripts I have installed:

[Statistics]
FileName=Stats.vbs

[ExportHTML]
FileName=Export.vbs

[ExportXML]
FileName=Export.vbs

[ExportCSV]
FileName=Export.vbs

[ExportXLS]
FileName=Export.vbs

[AutoIncTrackN]
FileName=AutoIncTrackN.vbs

[SwapArtistTitle]
FileName=SwapArtistTitle.vbs

[Case]
FileName=Case.vbs

[ExportM3Us]
FileName=ExportM3Us.vbs

[StayInSameStyleDJ]
Filename=StayInSameStyleDJ.js

[AlbumArtTagger]
Filename=AlbumArtTagger.vbs

[PersonalTagEnhancer]
Filename=PersonalTagEnhancer.vbs

[Backup]
Filename=Auto\Backup.vbs

[GenreFinder]
FileName=Auto\GenreFinder.vbs

[BatchArtFinder]
Filename=Auto\BatchArtFinder.vbs

[CustomReport]
Filename=CustomReport.vbs

[SimilarArtists]
Filename=Auto\SimilarArtists.vbs

[lyricsplugin]
Filename=lyricsplugin.vbs

[ClearField]
Filename=ClearField.vbs

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan » Tue Feb 19, 2008 8:09 am

The Personal Tag Enhancer is the cause of your error, it is the script which is conflicting with this one.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous » Tue Feb 19, 2008 8:22 am

All - thanks for your patience. I'm determined to figure this one out - I do like a challenge. As I mentioned earlier, none of the scripts I had loaded caused any problems on my system prior to my posting this. Nyn discovered my script breaks when she added Bex's SQL Viewer script, so I tried installing it, and lo, now my script is broken also. So at least now I've got something to work with to try to problem solve. :-?

I've got two places in my script where I have a script.include line. If any of the scripting veterans have any suggestions...

For those determined to use this - but willing to forgo some of the scripts working off my right click menu, you could try the instructions below. This should work with most scripts, but those that bring up a form when they run will likely fail (at least they do on my system). so this isn't a solution, but maybe will give someone smarter than me :oops: a clue how to help me fix the issue...

Delete or comment out the following section (it's right before 'Sub OnStartup()' )

Code: Select all

For i = 1 to numScripts 
      'For some reason scripts in the Auto folder cause it to fail here 
      'If anyone has a suggestion to improve this, please let me know...  :-) 
      If left(mnuScript(i),5) <> "Auto\" Then 
         Script.Include(sdb.ApplicationPath & "Scripts\" & mnuScript(i)) 
      End If 
Next
Change 'Sub doMenu(o)' to look like this:

Code: Select all

Sub DoMenu(o) 
   For i = 1 to numScripts 
      If o.Caption = mnuCaption(i) Then 
            Script.Include(sdb.ApplicationPath & "Scripts\" & mnuScript(i)) 
         Execute(mnuProc(i)) 
      End If 
   Next 
End Sub
P.S. I don't have much time to work on this during the week, so please be patient if most of my work doesn't happen till the weekends :)

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan » Tue Feb 19, 2008 9:01 am

onenonymous wrote:All - thanks for your patience. I'm determined to figure this one out - I do like a challenge. As I mentioned earlier, none of the scripts I had loaded caused any problems on my system prior to my posting this. Nyn discovered my script breaks when she added Bex's SQL Viewer script, so I tried installing it, and lo, now my script is broken also. So at least now I've got something to work with to try to problem solve. :-?

I've got two places in my script where I have a script.include line. If any of the scripting veterans have any suggestions...

For those determined to use this - but willing to forgo some of the scripts working off my right click menu, you could try the instructions below. This should work with most scripts, but those that bring up a form when they run will likely fail (at least they do on my system). so this isn't a solution, but maybe will give someone smarter than me :oops: a clue how to help me fix the issue...

Delete or comment out the following section (it's right before 'Sub OnStartup()' )

Code: Select all

For i = 1 to numScripts 
      'For some reason scripts in the Auto folder cause it to fail here 
      'If anyone has a suggestion to improve this, please let me know...  :-) 
      If left(mnuScript(i),5) <> "Auto" Then 
         Script.Include(sdb.ApplicationPath & "Scripts" & mnuScript(i)) 
      End If 
Next
Change 'Sub doMenu(o)' to look like this:

Code: Select all

Sub DoMenu(o) 
   For i = 1 to numScripts 
      If o.Caption = mnuCaption(i) Then 
            Script.Include(sdb.ApplicationPath & "Scripts" & mnuScript(i)) 
         Execute(mnuProc(i)) 
      End If 
   Next 
End Sub
P.S. I don't have much time to work on this during the week, so please be patient if most of my work doesn't happen till the weekends :)
This solution eliminated both errors on my machine and I am able to use both the SQL Viewer and Personal Tag Enhancer scripts along with the Right Click script.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

bob61
Posts: 157
Joined: Sun Dec 09, 2007 4:52 pm

Post by bob61 » Tue Feb 19, 2008 7:00 pm

onenonymous wrote:All - thanks for your patience. I'm determined to figure this one out - I do like a challenge. As I mentioned earlier, none of the scripts I had loaded caused any problems on my system prior to my posting this. Nyn discovered my script breaks when she added Bex's SQL Viewer script, so I tried installing it, and lo, now my script is broken also. So at least now I've got something to work with to try to problem solve. :-?

I've got two places in my script where I have a script.include line. If any of the scripting veterans have any suggestions...

For those determined to use this - but willing to forgo some of the scripts working off my right click menu, you could try the instructions below. This should work with most scripts, but those that bring up a form when they run will likely fail (at least they do on my system). so this isn't a solution, but maybe will give someone smarter than me :oops: a clue how to help me fix the issue...

Delete or comment out the following section (it's right before 'Sub OnStartup()' )

Code: Select all

For i = 1 to numScripts 
      'For some reason scripts in the Auto folder cause it to fail here 
      'If anyone has a suggestion to improve this, please let me know...  :-) 
      If left(mnuScript(i),5) <> "Auto" Then 
         Script.Include(sdb.ApplicationPath & "Scripts" & mnuScript(i)) 
      End If 
Next
Change 'Sub doMenu(o)' to look like this:

Code: Select all

Sub DoMenu(o) 
   For i = 1 to numScripts 
      If o.Caption = mnuCaption(i) Then 
            Script.Include(sdb.ApplicationPath & "Scripts" & mnuScript(i)) 
         Execute(mnuProc(i)) 
      End If 
   Next 
End Sub
P.S. I don't have much time to work on this during the week, so please be patient if most of my work doesn't happen till the weekends :)
Resolved problem with the error at MM3 start-up, but found that several scripts, such as Case Checker, won't run - expect this to be the scripts that bring up a form that you mentioned.

Hopefully you can get this fully resolved - thanks again for your efforts.

bob61
Posts: 157
Joined: Sun Dec 09, 2007 4:52 pm

Post by bob61 » Tue Feb 19, 2008 7:07 pm

nynaevelan wrote:The Personal Tag Enhancer is the cause of your error, it is the script which is conflicting with this one.

Nyn
Thanks Nyn - that was indeed the one. I've put back the original right click script and removed the personal tag enhancer and all works fine now. I think I'll have more use from the right click option than I will from the personal tag enhancer for the present time so I'll keep it like this for time being.

Just curious, how did you determine this script was the cause?

Thanks again.

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan » Tue Feb 19, 2008 9:26 pm

bob61 wrote:
nynaevelan wrote:The Personal Tag Enhancer is the cause of your error, it is the script which is conflicting with this one.

Nyn
Thanks Nyn - that was indeed the one. I've put back the original right click script and removed the personal tag enhancer and all works fine now. I think I'll have more use from the right click option than I will from the personal tag enhancer for the present time so I'll keep it like this for time being.
I am having the same issues. I too will put the original RC back, and like Bob I will get more use out of this script than the SQL Viewer, so I will remove that one until this can be resolved. I think I will also post a message in Bex's forum to see if he has any ideas how to resolve this from his end.
bob61 wrote:Just curious, how did you determine this script was the cause?

Thanks again.
I looked at your list to see which ones you had that I didn't. Then I just removed each from the Scripts folder to see if the RC script would begin without the error.
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous » Sat Feb 23, 2008 1:36 pm

I've discovered one of the problems that prevents some scripts (such as Case.vbs and BatchArtFinder.vbs) from working correctly off of my right-click menu and have a workaround. The problem shows up with other scripts that I try to run off my right click menu when they use "Script.ScriptPath". In these cases, because my script called theirs, Script.ScriptPath in their script returns the path to my script not theirs. I haven't found any way to modify my script so that when they call Script.ScriptPath it finds their script correctly, so have a workaround that involves you editing the other files. I'm not happy with this solution, but it seems to work. Please do this carefully and make sure to back up the other scripts if you're not sure of your editing skills. I've been testing on my system, and so far everything seems ok.

Here's how to do it:
1) Save the original script from the first message in this thread.
2) Make the modifications I described earlier in this thread. (Once I hear from a few of you that this works, I'll update the original post.)
3) Re-start MM and try out the new right-click menu.
4) For any script you try to run of off my right-click menu that gives you an error "Error happened during script execution: Uknown name" you will have to edit the other script to replace Script.ScriptPath with the path to that other script. Instructions for this follow.

If any of the MM script masters have any suggestions as to how I can modify my code to avoid users having to change the other scripts, I'd appreciate suggestions.

Edits to other scripts - USE AT YOUR OWN RISK
1) Open each script that errors under my right-click and add the code below after Option Explicit but before the first Sub or Function. Replace the scriptname portion (e.g. Auto\XXXX.vbs" in the code below) with the filename for the script. If the script is in Scripts rather than Auto folder, leave out the 'Auto\' portion. Two scripts I needed to update are Case.vbs and /Auto/BatchArtFinder.vbs. You may have others that need editing.
For example, for BatchArtFinder.vbs:

Code: Select all

Dim sPath 
sPath = sdb.ApplicationPath & "Scripts\Auto\BatchArtFinder.vbs"
For example, for Case.vbs:

Code: Select all

Dim sPath 
sPath = sdb.ApplicationPath & "Scripts\Case.vbs"
2) Next search and replace all instances of Script.ScriptPath with sPath
3) Save the file - be sure it names it with '.vbs' rather than '.vbs.txt' if you use NotePad.
4) Restart MM and try out the new code. The scripts you edited should work from my right-click menus as well as the original Tools/Scripts menu.
5) Repeat as needed for other scripts.

If you run into problems, please provide as much info about which script you were trying to use and the error message you received.

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan » Sat Feb 23, 2008 5:38 pm

Ok I tried your suggestions and it was able to fix the Case and BatchArtFinder but in testing all the scripts to ensure they work from the menu I came up with two other errors. This is the error I get when I try to run Trixmoto's Backup script from the RC menu, by the way that is not the name of the RC script:

Image

These are the errors I get when I run the Swap Two Fields script:

Image

Image

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous » Sat Feb 23, 2008 6:09 pm

check the lines you added to Backup.vbs to make sure they are correct. The follow should be placed on a line after Option Explicit:

Code: Select all

Dim sPath 
sPath = sdb.ApplicationPath & "Scripts\Auto\Backup.vbs"
I'm guessing (hoping :-) )that you entered it wrong.

Swap Two Fields works on my system - which script do you have that in?

Also, can you try changing Skins to see if the problems persist? The errors appear related to a skin perhaps.

Thanks for being a test subject. :lol:

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan » Sat Feb 23, 2008 6:25 pm

onenonymous wrote:check the lines you added to Backup.vbs to make sure they are correct. The follow should be placed on a line after Option Explicit:

Code: Select all

Dim sPath 
sPath = sdb.ApplicationPath & "Scripts\Auto\Backup.vbs"
I'm guessing (hoping :-) )that you entered it wrong.
I think this might be an unrelated problem because there are no instances of the Script Path in this script. I also tried to change the script name to the same as the error message, and for some reason it is adding an additional A at the beginning of the name. :evil:
onenonymous wrote:Swap Two Fields works on my system - which script do you have that in?
It is in the Custom Scripts.vbs file, is that what yours is in?
onenonymous wrote:Also, can you try changing Skins to see if the problems persist? The errors appear related to a skin perhaps.
Changing the skin does not change the errors.
onenonymous wrote:Thanks for being a test subject. :lol:
No problem, I like this script and I want to get it up and running smoothly.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous » Sat Feb 23, 2008 7:38 pm

nynaevelan wrote:I think this might be an unrelated problem because there are no instances of the Script Path in this script. I also tried to change the script name to the same as the error message, and for some reason it is adding an additional A at the beginning of the name. :evil:
Backup.vbs in Scripts/Auto does have numerous instances of Script.ScriptPath. Make sure you're not searching for Script.Script[space]Path.

Backup.vbs also has a routine which adds the A at the beginning of the filename to run routines in the file Scripts/ABackup.vbs, so that's what's causing the error you got with the error message referring to "ARightClickMenuType0.vbs". Use your text editor to search for Script.ScriptPath in Backup.vbs. If you changed Scripts/Auto/Backup.vbs to ABackup.vbs, then you should change it back to Backup.vbs. The filename must match the name you have in Scripts.ini as well is in the line you should have added into Backup.vbs:

Code: Select all

sPath = sdb.ApplicationPath & "Scripts\Auto\Backup.vbs"
I don't have a file named Custom Scripts - can you point me to it and I'll install to see if I have a problem.

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan » Sat Feb 23, 2008 8:48 pm

onenonymous wrote:
nynaevelan wrote:I think this might be an unrelated problem because there are no instances of the Script Path in this script. I also tried to change the script name to the same as the error message, and for some reason it is adding an additional A at the beginning of the name. :evil:
Backup.vbs in Scripts/Auto does have numerous instances of Script.ScriptPath. Make sure you're not searching for Script.Script[space]Path.

Backup.vbs also has a routine which adds the A at the beginning of the filename to run routines in the file Scripts/ABackup.vbs, so that's what's causing the error you got with the error message referring to "ARightClickMenuType0.vbs". Use your text editor to search for Script.ScriptPath in Backup.vbs. If you changed Scripts/Auto/Backup.vbs to ABackup.vbs, then you should change it back to Backup.vbs. The filename must match the name you have in Scripts.ini as well is in the line you should have added into Backup.vbs:

Code: Select all

sPath = sdb.ApplicationPath & "Scripts\Auto\Backup.vbs"
I forgot that one, I checked the Abackup and Abackup2 files, it's working now. :oops:
onenonymous wrote:I don't have a file named Custom Scripts - can you point me to it and I'll install to see if I have a problem.
This is the script that is giving me trouble.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous » Sat Feb 23, 2008 10:20 pm

nynaevelan wrote:url=http://www.mediamonkey.com/forum/viewtopic.php?t=5160] This[/url] is the script that is giving me trouble.
hmmm - I'm not having a problem with this script. Did you do the search and replace routing on Custom Script.vbs also? It's got a couple of instances of Script.ScriptPath also.

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan » Sat Feb 23, 2008 10:35 pm

Yes, I just went and double-checked, it has something to do with that box. Did you try the Swap two fields from the menu and the script?? It works from the menu but not the script on my machine.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

Post Reply