[Solved] How to add script to media tree context menu?

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: [Solved] How to add script to media tree context menu?

Re: How to add script to media tree context menu?

by pokeefe0001 » Sat Dec 18, 2021 7:40 pm

Erwin Hanzl wrote: Fri Dec 10, 2021 11:00 am No script is easy to read.
True, but the script I mentioned uses a colon as line separator making it nearly impossible to read unedited. This could be to make for a shorter file to download, but I think it's also for obfuscation. The script uses an apparently random mix of upper and lower case letters which, as near as I can tell, serves no purpose other than to make it difficult to read.

Anyway, if I understand the question I was asking, I actually had the answer 4 months ago. I had already added a script to the File context menu. For this latest script I put the following in the Auto scripts folder.

Code: Select all

Sub OnStartup

    With SDB.UI.AddMenuItem(SDB.UI.Menu_File, 2, 3)
        .Caption="Import SBD M3U playlist " 
        .UseScript=Script.ScriptPath
        .OnClickFunc="InnerInvocation"
        .IconIndex=57
    End With
End Sub

Sub includeFile(fSpec)
    With CreateObject("Scripting.FileSystemObject")
       executeGlobal .openTextFile(fSpec).readAll()
    End With
End Sub

Sub InnerInvocation(Load)

includeFile(SDB.ScriptsPath & "ImportSBDM3U.vbs")
ImportSBDM3U
End Sub
I have no idea if that is the way we're supposed to do it, but it works.
This is also an answer to the viewtopic.php?f=19&t=99602
("Any way to execute a type=0 script that isn't in scritps.ini?")
thread I posted last July.

Re: How to add script to media tree context menu?

by Erwin Hanzl » Fri Dec 10, 2021 11:00 am

CustomFieldsTagger
https://www.mediamonkey.com/addons/brow ... ldstagger/

No script is easy to read.

[Solved] How to add script to media tree context menu?

by pokeefe0001 » Thu Dec 02, 2021 8:18 pm

This is a spinoff from my thread viewtopic.php?f=19&t=100743&e=1&view=unread#unread

How do I get a script added to the context menu used by the Media Tree? I know this can be done because Zvezdan Dimitrijevic does it in the ExportM3UsForSubNodes script. However, that script is "compressed - using : instead of newline - so it's very hard to read. I searched it to "context" but there was no hit.

Is there any other, more easily read script that adds itself to the context menu?

Top