[MM2+3] Search Google, Wikipedia, Last.fm, ...
Posted: Mon Jan 30, 2006 2:32 am
As a Wish of Mhesse, here is a small script which creates 2 Entries in the Find more From - Menu-Item to Search google for "the Artist" or "the Artist and the Album".
Maybe someone else needs it too.
BTW: The URL google.de can easily be changed
- Create a file Google.vbs in Scripts\Auto and paste the code into it.
- Start MM.
- Enjoy!
Maybe someone else needs it too.
BTW: The URL google.de can easily be changed
- Create a file Google.vbs in Scripts\Auto and paste the code into it.
- Start MM.
- Enjoy!
Code: Select all
Sub OnStartUp
SDB.UI.AddMenuItemSep SDB.UI.Menu_Pop_TrackList_MoreFrom, -1, -1
SDB.UI.AddMenuItemSep SDB.UI.Menu_Pop_NP_MoreFrom, -1, -1
Dim MenuItem
Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList_MoreFrom, -1, -1)
MenuItem.Caption = SDB.Localize("Artist") + " (google.de)"
MenuItem.IconIndex = 37
MenuItem.OnClickFunc = "Google"
MenuItem.UseScript = Script.ScriptPath
MenuItem.Hint = "Artist"
Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP_MoreFrom, -1, -1)
MenuItem.Caption = SDB.Localize("Artist") + " (google.de)"
MenuItem.IconIndex = 37
MenuItem.OnClickFunc = "Google"
MenuItem.UseScript = Script.ScriptPath
MenuItem.Hint = "Artist"
Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList_MoreFrom, -1, -1)
MenuItem.Caption = SDB.Localize("Album") + " (google.de)"
MenuItem.IconIndex = 37
MenuItem.OnClickFunc = "Google"
MenuItem.UseScript = Script.ScriptPath
MenuItem.Hint = "Album"
Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP_MoreFrom, -1, -1)
MenuItem.Caption = SDB.Localize("Album") + " (google.de)"
MenuItem.IconIndex = 37
MenuItem.OnClickFunc = "Google"
MenuItem.UseScript = Script.ScriptPath
MenuItem.Hint = "Album"
Set MenuItem = Nothing
End Sub
Sub Google(MenuItem)
if SDB.SelectedSongList.Count > 0 then
Dim Song
Set Song = SDB.SelectedSongList.Item(0)
Dim Artist
Dim Album
Artist = "%22" + Replace(Song.ArtistName, " ", "%20") + "%22"
Artist = Replace(Artist, "&", "%26")
Album = "%22" + Replace(Song.AlbumName, " ", "%20") + "%22"
Album = Replace(Album, "&", "%26")
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
if MenuItem.Hint = "Artist" then
WshShell.Run("www.google.de/search?q=" + Artist + "")
else
WshShell.Run("www.google.de/search?q=" + Artist + "+" + Album)
end if
Set WshShell = Nothing
end if
end Sub