How to add Script to Context menu?

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

dtsig
Posts: 3588
Joined: Mon Jan 24, 2011 6:34 pm

How to add Script to Context menu?

Post by dtsig »

I am looking for a sample 'stub' script which adds its name to the Context menu (right-click) and then can be executed. Anyone know of one?
Thanks
Where's the db and ini stored
Reporting Bugs
Where tags are stored

Not affiliated with MediaMonkey ... just a RABID user/lover
DTSig
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: How to add Script to Context menu?

Post by trixmoto »

Yeah, some of my scripts definitely do this, but I can't think of one of the top of my head. I'll have a look later and let you know.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: How to add Script to Context menu?

Post by trixmoto »

My "Randomise Playlist" script adds an item to the tree's context menu, and uses a it's own "ShowMenu" function to determine whether or not it should be visible...

Code: Select all

    Set itm = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_Tree,1,0)
    itm.Caption = "Randomise Playlist"
    itm.OnClickFunc = "ItmClick"
    itm.UseScript = Script.ScriptPath
    itm.IconIndex = 25  
    itm.Visible = False
    Set SDB.Objects("RandomisePlaylistMenu") = itm
    Call Script.RegisterEvent(SDB,"OnChangedSelection","ShowMenu")
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: How to add Script to Context menu?

Post by trixmoto »

My "Previewer" script adds an item to the Now Playing list's context menu and the main window's context menu...

Code: Select all

    Dim itm1 : Set itm1 = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP,0,0)
    itm1.Caption = "Previewer"
    itm1.OnClickFunc = "Toolbar"
    itm1.UseScript = SDB.ApplicationPath&"Scripts\Previewer.vbs"
    itm1.IconIndex = IconIndex
    Set SDB.Objects("Previewer-Menu1") = itm1
    Dim itm2 : Set itm2 = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList,0,0)
    itm2.Caption = "Preview this track"
    itm2.OnClickFunc = "Toolbar"
    itm2.UseScript = SDB.ApplicationPath&"Scripts\Previewer.vbs"
    itm2.IconIndex = IconIndex
    Set SDB.Objects("Previewer-Menu2") = itm2
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
dtsig
Posts: 3588
Joined: Mon Jan 24, 2011 6:34 pm

Re: How to add Script to Context menu?

Post by dtsig »

Great .. thanks man. I will start studying these.
Where's the db and ini stored
Reporting Bugs
Where tags are stored

Not affiliated with MediaMonkey ... just a RABID user/lover
DTSig
Post Reply