FavouriteNodes: Add Favourite Nodes submenu to MediaMonkey

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

FavouriteNodes: Add Favourite Nodes submenu to MediaMonkey

Post by Steegy »

:: FavouriteNodes' own forum post.


Description:

The FavouriteNodes script adds a submenu to the standard toolbar with favourite nodes (with custom names and shortcut keys) you can specify.
To add a tree node to the favourite nodes list, right click the node and choose "Add to favourite nodes".

The script needs MediaMonkey version 2.5.2 or above.


Installing automaticly:

Installer for version 1.2 (latest, updated 31.03.2006): http://home.scarlet.be/ruben.castelein/ ... des1.2.exe
Just run the exe and follow the instructions.


Installing manually:

For people that have an older version of the script:
In this new version, the script is standalone. That means that you don't need the StoreStartupAndFavouriteNodes anymore.
Because you can now add shortcut keys, the storage format for the favourites has been changed. This means you will have to (remove and readd your favourites, or) change the FavouriteNodes saved favourites specification in the MediaMonkey.ini settings file. See at the end of the post for more info.


This newer version uses new built in functionality in MediaMonkey, so it will work faster.

The script consists of 1 standalone script file ("FavouriteNodes.vbs")

FavouriteNodes.vbs (for the Scripts\Auto folder)

Code: Select all

'========================================================================== 
' 
' MediaMonkey Script 
' 
' NAME: FavouriteNodes v1.1 
' DESCRIPTION: 
'  Adds a submenu to the standard toolbar with favourite nodes you can specify.
' 
' AUTHOR: Steegy aka RC (Ruben Castelein)
' DATE  : 20.01.2006
' UPDATE: 31.03.2006
' 
' INSTALL: 
' - Copy script to MediaMonkey's "Scripts\Auto" folder
' 
' The script needs MediaMonkey version 2.5.2 or above. 
' 
' The script's settings in the "Variable Configuration" section can be modified
' 
'========================================================================== 
'>> ForumURL: http://www.mediamonkey.com/forum/viewtopic.php?t=7656
'>> ScriptName: FavouriteNodes 
'>> VersionNumber: 1.1 
'>> Author: Steegy aka RC (Ruben Castelein)
'>>>>EndOfProperties 


'############################################################################################## 
'%%%%%%%%%%%%%%%%%%%%% 
' Script declarations: 
'%%%%%%%%%%%%%%%%%%%%% 
Option Explicit 

Dim splitString
    splitString = "§$§$§"

Dim FavouriteNodes
    Set FavouriteNodes = CreateObject("Scripting.Dictionary")

Dim MessageHeader
    MessageHeader = "FavouriteNodes:" & vbNewline & vbNewline 

'Imports
'Script.Include(SDB.ApplicationPath & "Scripts\Utility_General.vbs")

'############################################################################################## 
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
' Variable Configuration: (HERE YOU CAN MAKE SOME CHANGES IF YOU WANT) 
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
' 

Dim Error_BrowseToNode
    Error_BrowseToNode = "An error occured while auto-opening the specified node. "_ 
                       & "Possibly, the node specification is incorrect."_ 
                       & vbNewline & "The node has been opened as far as possible." 


Dim isStartupNodeExpanded	' Expand (True) or don't expand (False) the favourite node
    isStartupNodeExpanded = True


'############################################################################################## 
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
' The subroutines and functions that make this text file a "program": 
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

Sub OnStartup

  InitialiseFavouriteNodes

  Dim i

  Dim FavouriteNodesKeys
      FavouriteNodesKeys = FavouriteNodes.Keys

  ' Adds toolbar button (home icon) MyFavNodesTBB submenu to the standard toolbar
  SDB.UI.AddMenuItemSep SDB.UI.Menu_TbStandard,0,0

  Dim MyFavNodesTBB
      Set MyFavNodesTBB = SDB.UI.AddMenuItemSub(SDB.UI.Menu_TbStandard,0,0) 
  MyFavNodesTBB.Caption = SDB.Localize("Favourite nodes")
  MyFavNodesTBB.IconIndex = 61

  Dim miFavouriteNode
  For i = 0 To FavouriteNodes.Count - 1
    Set miFavouriteNode = SDB.UI.AddMenuItem(MyFavNodesTBB,0,0)
    With miFavouriteNode 
       .Caption = FavouriteNodesKeys(i)
     .Hint = ArrayToPathString(FavouriteNodes(FavouriteNodesKeys(i)))
      .OnClickFunc = "BrowseIt" 
      .UseScript = Script.ScriptPath 
      .ShortCut = FavouriteNodes(FavouriteNodesKeys(i))(UBound(FavouriteNodes(FavouriteNodesKeys(i))))
    End With
    Set SDB.Objects("FavouriteNodes_" & FavouriteNodesKeys(i)) = miFavouriteNode
  Next
  
  Set SDB.Objects("MyFavNodesTBB") = MyFavNodesTBB



  ' Adds item miAddToFavouriteNodes to the tree node popup menu
  SDB.UI.AddMenuItemSep SDB.UI.Menu_Pop_Tree,0,0

  Dim miAddToFavouriteNodes 
  Set miAddToFavouriteNodes = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_Tree,0,0) 
  With miAddToFavouriteNodes
    .Caption = "Add to favourite nodes"
    .OnClickFunc = "addToFavouriteNodes" 
    .UseScript = Script.ScriptPath 
    .IconIndex = 61 
  End With




  ' Adds the mRemoveFavouriteNodes submenu
  SDB.UI.AddMenuItemSep SDB.UI.Menu_Edit,0,0

  Dim mRemoveFavouriteNodes
  Set mRemoveFavouriteNodes = SDB.UI.addMenuItemSub(SDB.UI.Menu_Edit,0,0) 
  With mRemoveFavouriteNodes
    .Caption = "Remove nodes from favourites" 
    .Hint = "Remove a node from the favourite nodes list"
    .IconIndex = 61 
    .useScript = Script.ScriptPath 
  End With
  Set SDB.Objects("FavouriteNodesRemoveMenu") = mRemoveFavouriteNodes

  If Not FavouriteNodes Is Nothing Then
    Dim miFavouriteNodeRemove
    For i = 0 To FavouriteNodes.Count - 1
      Set miFavouriteNodeRemove = SDB.UI.AddMenuItem(mRemoveFavouriteNodes,0,0) 
      With miFavouriteNodeRemove
        .Caption = FavouriteNodesKeys(i)
        .Hint = ArrayToPathString(FavouriteNodes(FavouriteNodesKeys(i)))
        .IconIndex = 8 
        .OnClickFunc = "deleteNodeFromFavourites" 
        .UseScript = Script.ScriptPath 
      End With
    Next
  End If

End Sub



Function InitialiseFavouriteNodes

  InitialiseFavouriteNodes = False

  Set SDB.Objects("FavouriteNodes") = FavouriteNodes

  Dim FavouriteNodesCountINI
      FavouriteNodesCountINI = SDB.IniFile.StringValue("FavouriteNodes", "Count")
  If FavouriteNodesCountINI = "" Then Exit Function

  Dim i, PathToNode, PathToNodeArray

  For i = 1 To FavouriteNodesCountINI
    PathToNode = SDB.IniFile.StringValue("FavouriteNodes", "Fav" & i)
    PathToNodeArray = Split(PathToNode, splitString)

    FavouriteNodes.Add PathToNodeArray(0), PathToNodeArray
  Next

  InitialiseFavouriteNodes = True

End Function



Sub BrowseIt(arg)

  Dim FavouriteNodes
      Set FavouriteNodes = SDB.Objects("FavouriteNodes")

  Dim Result
      Result = BrowseToNode(FavouriteNodes.Item(arg.Caption))

  If Result = False Then 
    SDB.MessageBox MessageHeader & Error_BrowseToNode , mtError, Array(mbOk) 
  End If 

End Sub



Function BrowseToNode(FullPathToNode) 
  ' Browses to the specified node and returns True on success. 

  On Error Resume Next 

  Dim Node2B
      Set Node2B = SDB.MainTree.Node_NowPlaying

  Dim i
  For i = 1 To UBound(FullPathToNode) - 1
    
    If i > 1 Then
      Node2B.Expanded = True 
      Set Node2B = SDB.MainTree.FirstChildNode(Node2B) 
    End If

    If Not Node2B.Caption = FullPathToNode(i) Then 
      Do 
        Set Node2B = SDB.MainTree.NextSiblingNode(Node2B) 
        If Err <> 0 Then Exit Function 
      Loop While Node2B.Caption <> FullPathToNode(i) 
    End If 
  Next 
  
  SDB.MainTree.CurrentNode = Node2B 
  Node2B.Expanded = isStartupNodeExpanded 

  BrowseToNode = True

End Function




'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
' Remove a chosen favourite node
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
' 

Sub deleteNodeFromFavourites(Item)

  Dim FavouriteNodes
      Set FavouriteNodes = SDB.Objects("FavouriteNodes")


  ' Remove from toolbar submenu
  Dim NodeItemToBeDeleted
      Set NodeItemToBeDeleted = SDB.Objects("FavouriteNodes_" & Item.Caption)
  NodeItemToBeDeleted.Visible = False
  Set SDB.Objects("FavouriteNodes_" & Item.Caption) = Nothing


  ' Remove from dictionary
  FavouriteNodes.Remove(Item.Caption)


  ' Reorder Ini entries
  ReorderFavouriteNodesIni


  ' Remove from menu submenu
  Item.Visible = False

End Sub



Sub ReorderFavouriteNodesIni

  Dim FavouriteNodes
      Set FavouriteNodes = SDB.Objects("FavouriteNodes")

  If FavouriteNodes Is Nothing Then Exit Sub

  Dim FavouriteNodesKeys
      FavouriteNodesKeys = FavouriteNodes.Keys

  SDB.IniFile.StringValue("FavouriteNodes", "Count") = FavouriteNodes.Count

  Dim i
  For i = 0 To FavouriteNodes.Count - 1
    SDB.IniFile.StringValue("FavouriteNodes", "Fav" & (i + 1)) = ArrayToSplittedString(FavouriteNodes(FavouriteNodesKeys(i)))
  Next

  SDB.IniFile.DeleteKey "FavouriteNodes", "Fav" & (FavouriteNodes.Count + 1)

End Sub



'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
' addToFavouriteNodes
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
' 

Sub addToFavouriteNodes(arg) 

  Dim FavouriteName
      FavouriteName = InputBoxFavourite()

  If FavouriteName = "" Then
    Exit Sub
  End If

  Dim FavouriteNameArray
  FavouriteNameArray = Split(FavouriteName, splitString)

  Dim FavouriteNodes
      Set FavouriteNodes = SDB.Objects("FavouriteNodes")
  If FavouriteNodes.Exists(FavouriteNameArray(0)) Then
    SDB.MessageBox "A favourite node under this name already exists." , mtError, Array(mbOk)
    Exit Sub
  End If


  Dim PathToNode
      PathToNode = GetPathToNode(SDB.MainTree.CurrentNode)

  Dim NewFavouriteNodesCount
      NewFavouriteNodesCount = SDB.IniFile.StringValue("FavouriteNodes", "Count")
  If NewFavouriteNodesCount = "" Then
    NewFavouriteNodesCount = 1
  Else
    NewFavouriteNodesCount = NewFavouriteNodesCount + 1
  End If
  SDB.IniFile.StringValue("FavouriteNodes", "Count") = NewFavouriteNodesCount

  Dim ShortcutKey
  If UBound(FavouriteNameArray) = 1 Then
    ShortcutKey = FavouriteNameArray(1)
  Else
    ShortcutKey = ""
  End If

  SDB.IniFile.StringValue("FavouriteNodes", "Fav" & NewFavouriteNodesCount) = FavouriteNameArray(0) & splitString & PathToNode & splitString & ShortcutKey

  Dim PathToNodeArray
      PathToNodeArray = Split(FavouriteNameArray(0) & splitString & PathToNode & splitString & ShortcutKey, splitString)

  Dim MyFavNodesTBB
      Set MyFavNodesTBB = SDB.Objects("MyFavNodesTBB")

  Dim MyMoreArtist
      Set MyMoreArtist = SDB.UI.AddMenuItem(MyFavNodesTBB,0,0) 
  MyMoreArtist.Caption = FavouriteNameArray(0)
  MyMoreArtist.Hint = ArrayToPathString(PathToNodeArray)
  MyMoreArtist.OnClickFunc = "BrowseIt" 
  MyMoreArtist.UseScript = Script.ScriptPath
  MyMoreArtist.ShortCut = ShortcutKey
  Set SDB.Objects("FavouriteNodes_" & FavouriteNameArray(0)) = MyMoreArtist


  Dim FavouriteNodesRemoveMenu
      Set FavouriteNodesRemoveMenu = SDB.Objects("FavouriteNodesRemoveMenu")
  Dim AMyMoreArtist
      Set AMyMoreArtist = SDB.UI.AddMenuItem(FavouriteNodesRemoveMenu,0,0) 
  AMyMoreArtist.Caption = FavouriteNameArray(0)
  AMyMoreArtist.Hint = ArrayToPathString(PathToNodeArray)
  AMyMoreArtist.OnClickFunc = "deleteNodeFromFavourites" 
  AMyMoreArtist.UseScript = Script.ScriptPath
  AMyMoreArtist.IconIndex = 8 


  FavouriteNodes.Add FavouriteNameArray(0), PathToNodeArray

End Sub 



'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
' Some utility functions 
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
' 

Function ArrayToPathString(NodePathArray)
  ArrayToPathString = NodePathArray(1)

  Dim i
  For i = 2 to UBound(NodePathArray) - 1
    ArrayToPathString = ArrayToPathString & " > " & NodePathArray(i)
  Next

End Function



Function ArrayToSplittedString(NodePathArray)
  ArrayToSplittedString = NodePathArray(0)

  Dim i
  For i = 1 to UBound(NodePathArray)
    ArrayToSplittedString = ArrayToSplittedString & splitString & NodePathArray(i)
  Next

End Function


Function InputBoxFavourite()

   Dim Form, Label, Edt, Label2, Edt2, btnOk, btnCancel, modalResult 

   ' Create the window to be shown 
   Set Form = SDB.UI.NewForm 
   Form.Common.SetRect 100, 100, 360, 160 
   Form.BorderStyle  = 2   ' Resizable 
   Form.FormPosition = 4   ' Screen Center 
   'Form.SavePositionName = "FavouriteNodes_InputBox" 
   Form.Caption = "Add node to favourites"
      
   ' Create a button that closes the window 
   Set Label = SDB.UI.NewLabel(Form) 
   Label.Caption = "Enter a name for the favourite node:" 
   Label.Common.Left = 5 
   Label.Common.Top = 10
     
   Set Edt = SDB.UI.NewEdit(Form) 
   Edt.Common.Left = Label.Common.Left 
   Edt.Common.Top = Label.Common.Top + Label.Common.Height + 5 
   Edt.Common.Width = Form.Common.Width - 20 
   Edt.Common.ControlName = "Edit1" 
   Edt.Common.Anchors = 1+2+4 'Left+Top+Right 
   Edt.Text = SDB.MainTree.CurrentNode.Caption

   Set Label2 = SDB.UI.NewLabel(Form) 
   Label2.Caption = "Enter shortcut key:"
   Label2.Common.Left = Edt.Common.Left 
   Label2.Common.Top = Edt.Common.Top + Edt.Common.Height + 15 

   Set Edt2 = SDB.UI.NewEdit(Form) 
   Edt2.Common.Left = Label2.Common.Left + Label2.Common.Width + 5 
   Edt2.Common.Top = Label2.Common.Top - 3
   Edt2.Common.Width = 100 
   Edt2.Common.ControlName = "Edit2" 
   Edt2.Common.Anchors = 1+2+4 'Left+Top+Right 
   Edt2.Text = "" 
       
   ' Create a button that closes the window 
   Set BtnOk = SDB.UI.NewButton(Form) 
   BtnOk.Caption = "&OK" 
   BtnOk.Common.Top = Edt2.Common.Top + Edt2.Common.Height + 10 
   BtnOk.Common.Hint = "OK" 
   BtnOk.Common.Anchors = 4   ' Right 
   BtnOk.UseScript = Script.ScriptPath 
   BtnOk.Default = True
   BtnOk.ModalResult = 1 
    
   Set BtnCancel = SDB.UI.NewButton(Form) 
   BtnCancel.Caption = "&Cancel" 
   BtnCancel.Common.Left = Form.Common.Width - BtnCancel.Common.Width - 15 
   BtnOK.Common.Left = BtnCancel.Common.Left - BtnOK.Common.Width - 10 
   BtnCancel.Common.Top = BtnOK.Common.Top 
   BtnCancel.Common.Hint = "Cancel" 
   BtnCancel.Common.Anchors = 4   ' Right 
   BtnCancel.UseScript = Script.ScriptPath 
   BtnCancel.Cancel = True
   BtnCancel.ModalResult = 2 
       
   modalResult = Form.showModal 
       
   InputBoxFavourite = Cond(modalResult=1, Edt.Text & splitString & Edt2.Text, "") 
       
End Function


' Emulates (Test)?Result1:Result2 "conditional if" behaviour as in Java(Script) and other languages
Function Cond(Test, ResultTrue, ResultFalse)   ' Returns ResultTrue if Test evaluates to True, ResultFalse otherwise

  If test Then
    Cond = ResultTrue
  Else
    Cond = ResultFalse
  End If

End Function



' Returns the index of the specified KeyName in the specified Dictionary
'   Dictionary = Dictionary object
'   KeyName = Key (String) of the specified Dictionary
Function GetIndexOfDictionaryKey(Dictionary, KeyName)

  getIndexOfDictionaryKey = -1

  Dim DictionaryKeys
      DictionaryKeys = Dictionary.Keys

  Dim i

  For i = 0 To UBound(DictionaryKeys)
    If DictionaryKeys(i) = KeyName Then
      getIndexOfDictionaryKey = i
      Exit Function
    End If
  Next

End Function

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
' Function to get the path to the wanted node
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
' 

Function GetPathToNode(myNode)
  On Error Resume Next
  Dim myNode2
  
  Dim ParentNode
      Set ParentNode = myNode

  GetPathToNode = myNode.Caption

  Do While True

    Set myNode2 = SDB.MainTree.ParentNode(ParentNode)

    If myNode2 Is ParentNode Then
      Exit Do
    End If
    Set ParentNode = myNode2
    GetPathToNode = ParentNode.Caption & splitString & GetPathToNode

  Loop

End Function

In-depth information:

The script uses configuration entries in MediaMonkey's ini file.
(normally under folder My Documents\My Music\MediaMonkey)

Example:

Code: Select all

[FavouriteNodes]
Count=5
Fav1=Files to Edit§$§$§Library§$§$§Files to Edit§$§$§Ctrl+Alt+1
Fav2=Icecast directory§$§$§Net Radio§$§$§Icecast directory§$§$§Ctrl+Alt+2
Fav3=Mediumsoort§$§$§Magic Nodes§$§$§Mediumsoort§$§$§Ctrl+Alt+3
Fav4=Trance§$§$§Library§$§$§Genre§$§$§Trance§$§$§Ctrl+Alt+4
Fav5=Some Nice Songs: Lamb§$§$§Library§$§$§Artist§$§$§Lamb§$§$§Ctrl+Alt+5
The first part of each favourite entry is it's name (that you can freely choose). The rest is the path to the tree node (tree levels indicated by §$§$§). The last part is the shortcut key.

For people that want to use their old favourites on the new script version, just add "§$§$§Ctrl+Alt+5" or "§$§$§" at the end of the FavX lines. (without the quotes: the first sets shortcut keys Ctrl+Alt+5, the second doesn't uses shortcut keys).

Toolbar button and submenu, added to the standard toolbar.
Image

Submenu in the Edit menu, to remove favourites from the list.
Image



Shortcut keys that can be used: (from the scripting reference help)
for example Ctrl+Alt+2. Any standard character can be used, additional keys include: BkSp, Tab, Esc, Enter, Space, PgUp, PgDn, End, Home, Left, Up, Right, Down, Ins, Del and F1-F12. Any key could contain Ctrl+, Alt+ or Shift+ in front of it (and any combination of them).
Image
Last edited by Steegy on Sat Jun 18, 2011 4:25 pm, edited 8 times in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Tylast
Posts: 130
Joined: Sun Jan 29, 2006 12:54 pm
Location: US
Contact:

Post by Tylast »

Running RC3, I get the following error message:
Error #457
This key is already associated with an element of this collection
Line 110 Column 4

Any idea?
Image
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

Instead of searching for a fix to this problem, you can try a newer version I made a while ago. It should run good on most MM2.5.2's, and certainly on MM 2.5.2 RC-3.

Place the following file in MediaMonkey's "Scripts\Auto" folder.
[REMOVED: Nev version in the first post of this thread]

Please let me know if you have any problems with it.
I don't have time to look into this, but when things are going fine, I will change the current posted script with this one.

BTW: You don't need the StoreStartupAndFavouriteNodes script anymore. (I posted a link to a new version of StartupNode too, if you need that script)

Cheers
Steegy
Last edited by Steegy on Fri Mar 31, 2006 8:23 am, edited 1 time in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Tylast
Posts: 130
Joined: Sun Jan 29, 2006 12:54 pm
Location: US
Contact:

Post by Tylast »

OK...now I get the same error message with line 160.
Image
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

Ok, well at least you now have the new version...

The error occurs because there is something wrong in the configuration entries MediaMonkey's ini file (normally under "My Music\MediaMonkey").

You should get something like:

Code: Select all

[FavouriteNodes] 
Count=5 
Fav1=Files to Edit§$§$§Library§$§$§Files to Edit 
Fav2=Icecast directory§$§$§Net Radio§$§$§Icecast directory 
Fav3=Mediumsoort§$§$§Magic Nodes§$§$§Mediumsoort 
Fav4=Trance§$§$§Library§$§$§Genre§$§$§Trance 
Fav5=Some Nice Songs: Lamb§$§$§Library§$§$§Artist§$§$§Lamb 
Your error occurs because either the Count value is too large or it is right but there are still duplicates in the list.
Make sure that there are no two entries like Fav?=ThisPartHasToBeUnique§$§$§??????????§$§$§??????????
If you have 2 "ThisPartHasToBeUnique" entries, delete one.
And make sure if Count is 5 that all entries are numbered from 1 to 5.

Normally the script prevents duplicates, so I don't know how this happened.

If you don't have a clue to fix your [FavouriteNodes] entries, then post them here and I'll help.


Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Tylast
Posts: 130
Joined: Sun Jan 29, 2006 12:54 pm
Location: US
Contact:

Post by Tylast »

OK...no error messages anymore, but where are the favourite nodes located in the browser? I have the entries under the Edit menu though. I have the following in the INI file.

Code: Select all

[FavouriteNodes]
Count=1
Fav1=Music Folder§$§$§Library§$§$§Location§$§$§HD: (C:)§$§$§Documents and Settings§$§$§Tylast§$§$§My Documents§$§$§Music
Thanks!
Image
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

The script adds a button to the standard toolbar (it's a "house" icon).
I didn't add it to the tree because now it's much easier accessible, and that's one reason why we use favourites, isn't it.

The submenu in the Edit menu is only used to let you delete these favourites.

Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Tylast
Posts: 130
Joined: Sun Jan 29, 2006 12:54 pm
Location: US
Contact:

Post by Tylast »

OK got it...all is fine now...thanks for your patience!
Image
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

New version posted above.

For users upgrading from an old version, please read the comments in the first post to be able to keep your existing favourites.

Changes:
- Removed all dependencies
- Implemented new MM scripting functionality, so the script runs faster
- Added ability to set shortcut keys for the favourites
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

I was poking around, and changed the toolbar location from the standard toolbar to the tree navigation toolbar..
' Adds toolbar button (home icon) MyFavNodesTBB submenu to the standard toolbar
SDB.UI.AddMenuItemSep SDB.UI.Menu_TbNavigation,0,0

Dim MyFavNodesTBB
Set MyFavNodesTBB = SDB.UI.AddMenuItemSub(SDB.UI.Menu_TbNavigation,0,0)
MyFavNodesTBB.Caption = SDB.Localize("Favourite nodes")
MyFavNodesTBB.IconIndex = 61
Note, only the Bolded text is changed.

This puts it closer to the tree for easier mouse navigation (for me).

If you want it at the far left instead of right, change the 0's to 1.
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

I was wishing for something like this for favorite tracks/playlists...

So I can instantly play my favorite song(s) without diggin thru the library or playlists nodes.
salamat
Posts: 23
Joined: Sun Aug 20, 2006 3:32 am
Location: Philippines

Post by salamat »

Great script!
It works, but I can not asign the shortcut I want.... If I want ctrl+alt+P for prog rock, it's already used for track properties. If I use alt+p it's used for play, and if I try ctrl+p, it's used for pause, and shift+p is used for previews....So what chortcut is available??? The right alt+p seems to be available, but what is the shortcutsyntax for that one?

Thank you for making MM better and better!!!!! :D
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

Hey, from my part, you can use any shortcut key you want. Just make sure that it isn't in use yet, by testing it. If you hear a beep, it's most likely because it isn't a suitable key combination for a shortcut key.
E.g. don't use Ctrl+Alt+P because that opens the "Properties" dialog. (Already In Use)
E.g. don't use Shift+R because that will let the tracklist jump to the "R" character. (Unsuitable)
E.g. don't use Alt+P because that will try to open the menu (Alt) with shortcut key "P", but that normally doesn't exist, what will cause a beep. (Invalid)

For my "embedder suite" (MiniLyrics, On-screen Keyboard, Visualisation embedders) I use the shortcuts Ctrl+Shift+X (with X respectively L, K, V).
Oh no......, I just see that Shift+Ctrl+V is already in use .. :cry: (Analyze Volume). Well, that's too bad I guess.

Anyway, just try some that aren't in use yet...

Great you like the script!
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
johnbot
Posts: 18
Joined: Tue Apr 10, 2007 6:01 am

Dead download link

Post by johnbot »

I tried to downloading FavouriteNodes1.1.exe using the above link in the first post http://home.tiscali.be/ruben.castelein/ ... des1.1.exe
but it seems to be dead (gives only an empty webpage). Is there any other location to get it?
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm

Post by Steegy »

Yeah sorry. Tiscali has been renamed to scarlet, and since a week or so the old links don't work anymore. I still have to fix some of them.

Use this one:
http://home.scarlet.be/ruben.castelein/ ... des1.1.exe

Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Post Reply