Genre Shortcut Keys

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: Genre Shortcut Keys

Genre Shortcut Keys

by cldcp00 » Wed Dec 19, 2012 12:12 pm

Hi There,

I am trying to get the above script to work. I followed the instructions closely and installed it, but when I uise the keys to set the Genre nothing happens.

I also tried the script that sets the rating using keys same again.

Has anybody got these scripts to work? are they still used as the they forum for it seem old.

Any help would be most appreciated.

Regards

Desmond

Re: Genre Shortcut Keys

by Lowlander » Wed Sep 26, 2012 10:17 am

It needs to be in the Scripts\Auto folder not the Scripts folder. Then restart MediaMonkey.

Re: Genre Shortcut Keys

by AndyTR » Wed Sep 26, 2012 5:45 am

How do I install this script? I'm new to scripts and guessed and did the following:
Copied the text to Notepad
Named the file "Ratings.vbs"
Placed it in MM/Scripts

but it doesn't appear in my script list in Tools.

I expect I'm missing something obvious - help much appreciated.

Thanks

Re: Genre Shortcut Keys

by UksusoFF » Wed Apr 07, 2010 8:09 am

Hello! How can make global hotkeys from this script?

Re: Genre Shortcut Keys

by shemait » Wed Nov 26, 2008 2:00 pm

I actually figured this out on my own, so I will post it here, although it may not be very useful to many people, since it is based on setting the Tempo with ONLY letters. Example: I select a song that I think is "Upbeat" and click the letter "u." This changes that songs Tempo to "Upbeat." Of course, this is modifiable. For example, I made one that changes the Mood based on keyboard letters, as well.
Hope it helps someone!

Code: Select all

'==========================================================================
'
' MediaMonkey Script
'
' NAME: Predefined Tempo Script v1.0
'
' AUTHOR: Peke
' DATE  : 18.05.2005
'
' INSTALL: Change Defaults in "Variable Configuration" Section of this file
'
'==========================================================================
'==========================================================================
' Variable Definition (Do Not Change)
'==========================================================================

' Tempo Variables
Dim Str_Tempo1, Str_Tempo2, Str_Tempo3, Str_Tempo4, Str_Tempo5, Str_Tempo6, Str_Tempo7, 

Str_Tempo8, Str_Tempo9, Str_Tempo10 

' Hotkey Variables
Dim Use_Shift, Use_Ctrl, Use_Alt

'==========================================================================
' Variable Configuration
'==========================================================================
'Set Value to TRUE/FALSE if you want to it use in HotKey
Use_Shift = FALSE
Use_Ctrl  = FALSE
Use_Alt   = FALSE

'Change Tempos According to your needs
Str_Tempo1  = "Upbeat"
Str_Tempo2  = "Medium"
Str_Tempo3  = "Mellow"
Str_Tempo4  = "Country"
Str_Tempo5  = "Reggae"
Str_Tempo6  = "Hip-Hop"
Str_Tempo7  = "Alternative"
Str_Tempo8  = "Comedy"
Str_Tempo9  = "Sountrack"
Str_Tempo10 = "Pop"
'===< CONFIGUTARTION ENDED >===============================================

'==========================================================================
' MediaMonkey On Start Procedure
'==========================================================================
Sub OnStartup

  Dim HotKeyRing
  HotKeyRing = ""
  If Use_Shift Then
     HotKeyRing = HotKeyRing&"Shift+"
  End if
  If Use_Ctrl Then
     HotKeyRing = HotKeyRing&"Ctrl+"
  End if
  If Use_Alt Then
     HotKeyRing = HotKeyRing&"Alt+"
  End if

  Dim ETempo
  Set ETempo = SDB.UI.addMenuItemSub(SDB.UI.Menu_Edit,0,0)
  ETempo.caption = "Change Tempo"
  ETempo.IconIndex = 58
  ETempo.useScript = Script.ScriptPath
  
  Dim Tempo1
  Set Tempo1 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo1.Caption = "#1 "&Str_Tempo1
  Tempo1.OnClickFunc = "PredefinedTempo"
  Tempo1.UseScript = Script.ScriptPath
  Tempo1.IconIndex = 18
  Tempo1.ShortCut = HotKeyRing&"u"
  
  Dim Tempo2
  Set Tempo2 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo2.Caption = "#2 "&Str_Tempo2
  Tempo2.OnClickFunc = "PredefinedTempo"
  Tempo2.UseScript = Script.ScriptPath
  Tempo2.IconIndex = 18
  Tempo2.ShortCut = HotKeyRing&"e"
  
  Dim Tempo3
  Set Tempo3 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo3.Caption = "#3 "&Str_Tempo3
  Tempo3.OnClickFunc = "PredefinedTempo"
  Tempo3.UseScript = Script.ScriptPath
  Tempo3.IconIndex = 18
  Tempo3.ShortCut = HotKeyRing&"m"

  Dim Tempo4
  Set Tempo4 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo4.Caption = "#4 "&Str_Tempo4
  Tempo4.OnClickFunc = "PredefinedTempo"
  Tempo4.UseScript = Script.ScriptPath
  Tempo4.IconIndex = 18
  Tempo4.ShortCut = HotKeyRing&"4"

  Dim Tempo5
  Set Tempo5 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo5.Caption = "#5 "&Str_Tempo5
  Tempo5.OnClickFunc = "PredefinedTempo"
  Tempo5.UseScript = Script.ScriptPath
  Tempo5.IconIndex = 18
  Tempo5.ShortCut = HotKeyRing&"5"

  Dim Tempo6
  Set Tempo6 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo6.Caption = "#6 "&Str_Tempo6
  Tempo6.OnClickFunc = "PredefinedTempo"
  Tempo6.UseScript = Script.ScriptPath
  Tempo6.IconIndex = 18
  Tempo6.ShortCut = HotKeyRing&"6"

  Dim Tempo7
  Set Tempo7 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo7.Caption = "#7 "&Str_Tempo7
  Tempo7.OnClickFunc = "PredefinedTempo"
  Tempo7.UseScript = Script.ScriptPath
  Tempo7.IconIndex = 18
  Tempo7.ShortCut = HotKeyRing&"7"

  Dim Tempo8
  Set Tempo8 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo8.Caption = "#8 "&Str_Tempo8
  Tempo8.OnClickFunc = "PredefinedTempo"
  Tempo8.UseScript = Script.ScriptPath
  Tempo8.IconIndex = 18
  Tempo8.ShortCut = HotKeyRing&"8"

  Dim Tempo9
  Set Tempo9 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo9.Caption = "#9 "&Str_Tempo9
  Tempo9.OnClickFunc = "PredefinedTempo(9)"
  Tempo9.UseScript = Script.ScriptPath
  Tempo9.IconIndex = 18
  Tempo9.ShortCut = HotKeyRing&"9"

  Dim Tempo0
  Set Tempo0 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo0.Caption = "#10 "&Str_Tempo10
  Tempo0.OnClickFunc = "PredefinedTempo"
  Tempo0.UseScript = Script.ScriptPath
  Tempo0.IconIndex = 18
  Tempo0.ShortCut = HotKeyRing&"0"
  
End Sub

Sub EditTempo(Str_Tempo)
  Dim list, itm, i
  If SDB.SelectedSongList.count = 0 Then
    Result = SDB.MessageBox( "No tracks Selected!", mtError, Array(mbOk))
    Exit Sub
  End If
  Set list = SDB.SelectedSongList
  For i=0 To list.count-1
    Set itm = list.Item(i)
    itm.Tempo = Str_Tempo
    itm.UpdateDB
  Next

End Sub

Sub PredefinedTempo(Item)
   If Left(Item.Caption,3) = "#10" Then
     EditTempo(Right(Item.Caption,Len(Item.Caption)-4))
   Else
     EditTempo(Right(Item.Caption,Len(Item.Caption)-3))
   End If
End Sub

Re: Genre Shortcut Keys

by shemait » Wed Nov 19, 2008 6:17 pm

It would be great if I could assign Moods and/or Categories to hotkeys, as well. Maybe something like ALT+1 = my first Mood (Upbeat), and CTRL+! = my first Category (Background), and so on. I am currently working on trying to make sense of the genre script, and seeing if I think I can figure the changes out for myself, but haven't gotten too far (yet). Any help would be appreciated!

by jonp » Tue Jan 08, 2008 7:34 am

Is there a simply way to modify this script so the short cut keys add a selected song to a specific playlist rather than assign a genre?
Thanks.

by baker » Mon Jan 07, 2008 1:48 pm

I use this script all the time or a modified version. Any progress on the update mentioned earlier?

by Peke » Sat Jan 05, 2008 1:11 pm

It should Be OK No SQL Calls there.

by bob61 » Fri Jan 04, 2008 11:22 pm

Just curious - is this script OK for use with MM3?

Updated

by Negative Zero » Sat Jul 14, 2007 1:48 am

i've spent the last few hours tinkering around the innards of this script, mainly because i really wanted the ability to completely remove the rating from a song.

while i was at it, i also added the ability to assign a 0 (bomb) rating and (i think) made it a little more efficient by creating the menus inside a loop. i'm fairly new to scripting (and this is only my 1st post (2nd attempt) at writing for MM), so if that's a bad idea, please let me know.

any other comments would be welcome :)

Code: Select all

'==========================================================================
'
' MediaMonkey Script
'
' NAME: Predefined RATING Script v1.4
' DATE: 14.07.2007
'
' ADDITIONAL AUTHOR: Negative Zero
' DATE: 22.01.2006
'
' AUTHOR: LIMEX
' DATE: 22.01.2006
'
' ORIGINAL AUTHOR: Ralf K.
'DATE:   26.08.2005
'
' NOTE:   Idea taken from Pekes "Predefined Genre Script v1.0".
'               LIMEX: I changed to use buttons 1-0 instead of 1-5 in order to assign also 1/2 stars.
'
' INSTALLATION:
' - Feel free to change the constants at the beginning of this file
' - Copy script to MM directory scripts\auto
'
' USE:
' - Press key "`",1-0,"-" to rate the currently selected song(s)
' - If no song is selected then currently playing song is rated
'
' REMARK: Rating process now can be done very fast without additional mouse clicks:
'   1) Start playing a list
'   2) Make sure no tracks are selected (otherwise they catch the rating)
'   3) Listen to track; wind forward if needed with '3' on numeric pad
'   4) Press "`",1-0,"-" on normal keyboard for rating
'   5) Jump to next song with '9' an numeric pad
'   6) Continue with step 3)
'
'==========================================================================


'==========================================================================
' Define some constants
'==========================================================================
'Set Value to TRUE/FALSE if you want to use HotKey modifiers
const Use_Shift = FALSE  'TRUE
const Use_Ctrl  = FALSE  'TRUE
const Use_Alt   = FALSE  'TRUE

'Icon to be used in the menu
const MenuIcon  = 64     '=yellow star


'==========================================================================
' MediaMonkey on-start Procedure
'==========================================================================
Sub OnStartup
' --------------
' Build the hotkey modifier
' --------------
  Dim HotKeyRing
  HotKeyRing = ""

  If Use_Shift Then HotKeyRing = HotKeyRing&"Shift+"
  If Use_Ctrl Then HotKeyRing = HotKeyRing&"Ctrl+"
  If Use_Alt Then HotKeyRing = HotKeyRing&"Alt+"

' ----------------
' Create a new edit menu entry
' ----------------
' first we make a separator
  SDB.UI.AddMenuItemSep SDB.UI.Menu_Edit, 0, 0

' then we add the new menu
  Dim RatingMenu
  Set RatingMenu       = SDB.UI.addMenuItemSub(SDB.UI.Menu_Edit,0,0)
  With RatingMenu
      .caption   = "Change Rating"
      .IconIndex = MenuIcon
      .useScript = Script.ScriptPath
  End With

' ----------------
' Create the sub menus
' ----------------
  Dim RatingSubmenu(12), i, count, caption, key, icon

  count = -1
  For i = 0 To 11
    key = i
    caption = count&".5"    ' will be overwritten on first pass by second if statement below

    If i Mod 2 = 0 Then     ' satisfied only on even numbered loop iterations
      count = count+1
      caption = count&".0"
    End If

    caption = caption&" Stars"

    If i = 0 Then
      key = "`"
      caption = "0 Stars"
    ElseIf i = 10 Then
      key = 0
    ElseIf i = 11 Then
      key = "-"
      caption = "Unknown Rating"
    End If

    If i = 2 Then caption = Left(caption,Len(caption)-1)
    icon = "Y"
    If i = 0 Then icon = "N"
    If i = 11 Then icon = "N"

    Set RatingSubmenu(i) = SDB.UI.AddMenuItem(RatingMenu,0,0)
    With RatingSubmenu(i)
        .Caption     = caption
        .OnClickFunc = "PredefinedRating"
        .UseScript   = Script.ScriptPath
        .ShortCut    = HotKeyRing&key
        If icon = "Y" Then .IconIndex = MenuIcon
    End With
  Next

End Sub

'==========================================================================
' Helper and callback procedure
'==========================================================================
Sub EditRating(i_rating)
  Dim songlist, song, i

' ---------------
' First check which songs to alter
' ---------------
  If SDB.SelectedSongList.count > 0 Then
    Set songlist = SDB.SelectedSongList
  ElseIf SDB.Player.CurrentSongIndex >= 0 then
    Set songlist = SDB.NewSongList
    songlist.Add(SDB.Player.CurrentSong)
  Else
    Result = SDB.MessageBox("No tracks selected!", mtError, Array(mbOk))
    Exit Sub
  End If

' ---------------
' Change the songs rating
' ---------------
  For i = 0 To songlist.count-1
    Set song = songlist.Item(i)
    With song
        .Rating = i_rating
        .UpdateDB           'update MM database
        .WriteTags          'write data to file tag
    End With
  Next

' free memory again??
' songlist = nothing

End Sub


Sub PredefinedRating(i_menuItem)
'  Rating varies from 0 (= 0 stars) to 100 (= 5 stars)
'  So we multiply caption (= 1...0) with 10
   Dim i_rating
   i_rating = Right(i_menuItem.ShortCut,1)

   If i_rating = "`" Then
      i_rating = 0
   ElseIf i_rating = "-" Then
      i_rating = -1
   ElseIf i_rating = 0 Then
      i_rating = 100
   Else
      i_rating = i_rating*10
   End If

   EditRating(i_rating)
End Sub

by Peke » Mon Jan 08, 2007 7:22 pm

Things will be much simplified in MM 3.0.

by Guest » Sun Jan 07, 2007 12:58 pm

baker wrote:This is a great script. I've been using it to update not only genres but year and custom fields and. There's only one problem though.. Is there anyway to tell MM not to use these hotkeys when modifying a filename? For example, if I want to change a filename to "Beatles - Sgt Pepper", I can't do it unless I go into Properties because I have the 'B' key assigned to 'Blues'. Mucho gracias.

by baker » Sat Dec 23, 2006 10:47 pm

Hey Peke, thanks for a great script. If you want to add features, maybe you'd like to add a 'sub-genre' function? So that depending on the track's genre it would add the appropriate sub-genre to a custom field. For example, while hitting 'S' would simply update the Genre field , hitting 'Shift-S' would add either 'Ska' to Custom1 of a Reggae track or 'Soul' to an R&B track.

Just a thought..

by Peke » Fri Dec 22, 2006 10:14 pm

This is old script structure and I'm glad that it is still in use.

I'll see what can be done to make some Changes and use new MM goodies (read features) like Setup menu, implementing installer and few other things.

Top