Google Art Finder 2.7 [MM2+3]
Another odd error.. happened when I was updating the album of a track which did not previously have an album entered.
New script: Last.FM Node Now with DJ Mode!
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
hèhe, this "catastrophic fealure" error is funny, never had that one before
And look how descriptive the error message is...
And look how descriptive the error message is...
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Hello
MediaMonkey scripts have to be installed by copying the code in the previous page (there's code for 2 script files) to new script files for MediaMonkey's scripts folders. (as explained there, and on several other script pages).
Trixmoto supplies installers for his scripts at http://trixmoto.net/mm/scripts.php?id=1 so maybe it's just easier to download and run these. I don't know if these are the *latest* revisions however.
Cheers
Steegy
MediaMonkey scripts have to be installed by copying the code in the previous page (there's code for 2 script files) to new script files for MediaMonkey's scripts folders. (as explained there, and on several other script pages).
Trixmoto supplies installers for his scripts at http://trixmoto.net/mm/scripts.php?id=1 so maybe it's just easier to download and run these. I don't know if these are the *latest* revisions however.
Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
another feature suggestion:
right click any track and google search for art.
currently the script will only run on the 'now playing' track.
Alternatively, a toolbar button would work too, both would be even nicer.
right click any track and google search for art.
currently the script will only run on the 'now playing' track.
Alternatively, a toolbar button would work too, both would be even nicer.
New script: Last.FM Node Now with DJ Mode!
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
@Steegy: The installers are almost always the latest versions. I normally paste the code on the forum about 5 mins before my site is updated (as that is how long it takes to update my website with a new script version!)
@Teknojnky:
1) You can run the script from "Tools, Scripts" and it will run for the currently selected track.
2) No idea about the error. From my published code that's the line that makes the form visible, so there should be no error. However if you've changed the code, maybe that's a different line now?
3) I found that medium images gave the best results, but of course so you remove this. I might add a variable in the next version.
4) I will update the NewWindow bit, although I don't think my script will cope very well with you browser yourself. I think it will get very confused if you hit any of the buttons after doing so.
5) A previous button is difficult. The next button searches through for another image through all the images on the page, so the first image shown might be image 5 in the list. Then next might end up being 8. Going forwards you just continue to search from where you last found one, going backwards might be more difficult. I'll look into it.
6) I have no idea how to navigate around the red cross, but if I can find a way, I'll do it!
7) I could add a monitor script which autocloses the window. Although I was assuming that the person would copy the art and close the window almost straight away, so I hadn't forseen this as a useful feature.
@jiri: Any help on saving the form position? I can't seem to get it to save when I want it to.
@Teknojnky:
1) You can run the script from "Tools, Scripts" and it will run for the currently selected track.
2) No idea about the error. From my published code that's the line that makes the form visible, so there should be no error. However if you've changed the code, maybe that's a different line now?
3) I found that medium images gave the best results, but of course so you remove this. I might add a variable in the next version.
4) I will update the NewWindow bit, although I don't think my script will cope very well with you browser yourself. I think it will get very confused if you hit any of the buttons after doing so.
5) A previous button is difficult. The next button searches through for another image through all the images on the page, so the first image shown might be image 5 in the list. Then next might end up being 8. Going forwards you just continue to search from where you last found one, going backwards might be more difficult. I'll look into it.
6) I have no idea how to navigate around the red cross, but if I can find a way, I'll do it!
7) I could add a monitor script which autocloses the window. Although I was assuming that the person would copy the art and close the window almost straight away, so I hadn't forseen this as a useful feature.
@jiri: Any help on saving the form position? I can't seem to get it to save when I want it to.
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.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
The only modifications I've done was to the search url (i think), I would not have affected any line numbers.
My script will only run on the now playing track.
I can click a track in the now playing window, or the detail list window and neither will load with the script. I just re-verified just now.
As far as navigating the window, It does very well now... you can press the backspace key to go back (and it does), and you can right click on the html somewhere and navigate forward (if you've been forward). Standard IE control keys work fine. (assuming they arent in use by MM which obviously takes precedence)
In fact, with the window staying up, I can manually search for art while MM is playing and set the album art window to selected (instead of now playing) and drag and drop away.
Doesnt the IE control have a navigate.back and navigate.forward methods?
The current implentation closes the current window and opens a new one, ie if you have resized/moved the window it completely closes and opens an new one whenever the script runs. It either does this automatically from MM, or you explicitly do it (I havent checked). It does not reuse any currently open search window. (which could be another feature suggestion/option haha).
I am guessing that the script runs on track changes and checks for art and for the album tag then opens the new window. Based on my limited knowledge, I would expect you can either explicitly close a window if it exists, or possibly open a 'null' window which would force MM to close the window and display nothing.
So I would not think a monitor function would be necessary if the script does it during the checks at track change.
Normally I just leave the window open, one because I am too lazy to mouse over to the little bitty close icon, and two because the next time the script runs it will close and open a new window anyway.
Now, if there was a way to simply click on the image or a button to add it to the library (I think I saw that type of feature is coming in future betas) then the window could (optionally) close whenever the art or add art button is pressed.
Wheee I've blabbered on, hope some of this is helpful or helps you understand how its used or can be used.
My script will only run on the now playing track.
I can click a track in the now playing window, or the detail list window and neither will load with the script. I just re-verified just now.
As far as navigating the window, It does very well now... you can press the backspace key to go back (and it does), and you can right click on the html somewhere and navigate forward (if you've been forward). Standard IE control keys work fine. (assuming they arent in use by MM which obviously takes precedence)
In fact, with the window staying up, I can manually search for art while MM is playing and set the album art window to selected (instead of now playing) and drag and drop away.
Doesnt the IE control have a navigate.back and navigate.forward methods?
The current implentation closes the current window and opens a new one, ie if you have resized/moved the window it completely closes and opens an new one whenever the script runs. It either does this automatically from MM, or you explicitly do it (I havent checked). It does not reuse any currently open search window. (which could be another feature suggestion/option haha).
I am guessing that the script runs on track changes and checks for art and for the album tag then opens the new window. Based on my limited knowledge, I would expect you can either explicitly close a window if it exists, or possibly open a 'null' window which would force MM to close the window and display nothing.
So I would not think a monitor function would be necessary if the script does it during the checks at track change.
Normally I just leave the window open, one because I am too lazy to mouse over to the little bitty close icon, and two because the next time the script runs it will close and open a new window anyway.
Now, if there was a way to simply click on the image or a button to add it to the library (I think I saw that type of feature is coming in future betas) then the window could (optionally) close whenever the art or add art button is pressed.
Wheee I've blabbered on, hope some of this is helpful or helps you understand how its used or can be used.
New script: Last.FM Node Now with DJ Mode!
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
@Teknojnky:
You are right, it only works for now playing. This has now been corrected.
The IE does have forward and back but I don't use them because i'm retrieving a list of images from the first page and then just recursing through the list.
There will be methods to add the images to the tracks in the next release. So I will update this script again then to incorporate the new functionality.
You are right, it only works for now playing. This has now been corrected.
The IE does have forward and back but I don't use them because i'm retrieving a list of images from the first page and then just recursing through the list.
There will be methods to add the images to the tracks in the next release. So I will update this script again then to incorporate the new functionality.
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.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
New version (1.2) should now store form size and location, although it's not working brilliantly yet. It should also keep form on top and keep the browser actions within form. Running the script from tools now finds art for selected track and you can select image size you want (detault=medium).
NEW CODE BELOW
NEW CODE BELOW
Last edited by trixmoto on Mon Feb 20, 2006 5:54 am, edited 1 time in total.
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.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Super as always!
To help out and to learn, I've created a helper auto-script which adds a toolbar icon but I can't seem to get it to call the external function in the googleartfinder script.. (based off the favoritenodes script and the script help file)
I get the error:
Error happened during script execution:
OLE Error 800A01C2
also, is there a list of the icon index or how do I find a better icon
To help out and to learn, I've created a helper auto-script which adds a toolbar icon but I can't seem to get it to call the external function in the googleartfinder script.. (based off the favoritenodes script and the script help file)
Code: Select all
Sub OnStartup
SDB.UI.AddMenuItemSep SDB.UI.Menu_TbStandard,0,0 'separates the toolbar icon
Dim GoogleArtTBB
Set GoogleArtTBB = SDB.UI.AddMenuItem(SDB.UI.Menu_TbStandard,0,0)
GoogleArtTBB.Caption = SDB.Localize("Google Art Search!")
GoogleArtTBB.IconIndex = 1
GoogleArtTBB.UseScript = SDB.ApplicationPath & "Scripts\GoogleArtFinder.vbs"
GoogleArtTBB.OnClickFunc = "AutoArtFinder"
GoogleArtTBB.Shortcut = "Ctrl+G"
End Sub
Error happened during script execution:
OLE Error 800A01C2
also, is there a list of the icon index or how do I find a better icon
New script: Last.FM Node Now with DJ Mode!
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
@Teknojnky:
One error that may cause the problem you're having:
In this line, you call the sub "AutoArtFinder( <SDBMenuItem> )", instead of the sub "AutoArtFinder()" in the GoogleArtFinder.vbs file.
That means, the program expects to find a sub that gives you a reference to the clicked SDBMenuItem, but it can't find it.
A little workaround would be:
in your autostart script file:
in the GoogleArtFinder.vbs file:
(I didn't test it, but it is supposed to work )
For the icon index: look at my signature --> "resources".
Cheers
Steegy
One error that may cause the problem you're having:
Code: Select all
GoogleArtTBB.OnClickFunc = "AutoArtFinder"
That means, the program expects to find a sub that gives you a reference to the clicked SDBMenuItem, but it can't find it.
A little workaround would be:
in your autostart script file:
Code: Select all
GoogleArtTBB.OnClickFunc = "StartAutoArtFinderFromToolbar"
in the GoogleArtFinder.vbs file:
Code: Select all
Sub StartAutoArtFinderFromToolbar(TBB)
AutoArtFinder
End Sub
Sub AutoArtFinder
Dim song
Set song = SDB.Player.CurrentSong
If song.Album.AlbumArt is Nothing Then
ArtFinder(song)
End If
Set song = Nothing
End Sub
For the icon index: look at my signature --> "resources".
Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Wheeee
I couldnt get that to work, so I tried something different...
I added a button to the google art search window "Search Current" which is supposed to execute the sub "GoogleArtFinder", but I still get the OLE error.
This is within the Sub ArtFinder(song) section.
Unless I am missing something, this should call the same function as the menu?
I couldnt get that to work, so I tried something different...
I added a button to the google art search window "Search Current" which is supposed to execute the sub "GoogleArtFinder", but I still get the OLE error.
Code: Select all
Dim Btn3
Set Btn3 = SDB.UI.NewButton(Head)
Btn3.Caption = "Search Selected"
Btn3.Common.Height = 25
Btn3.Common.Width = Head.Common.Width
Btn3.Common.Top = 50
Btn3.UseScript = Script.ScriptPath
Btn3.OnClickFunc = "GoogleArtFinder"
Unless I am missing something, this should call the same function as the menu?
New script: Last.FM Node Now with DJ Mode!
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
What I said above works for me...
Install latest "GoogleArtFinder.vbs" and "GoogleArtFinder2.vbs" (and add entries to Scripts.ini file)
also put your autostarting code in a file in the Scripts\Auto folder (I call it "GoogleArtToolbarButton.vbs" here)
In "GoogleArtFinder.vbs":
add
In "Auto\GoogleArtToolbarButton.vbs":
replace
with
Restart MM and you should see that it works now...
ADDITION: Your latest posted code doesn't work for the same reason. Please read my explanation (first comment) again.
If you look to the syntax example for onClickFunc of a SDBButton:
for a SDBMenuItem:
Notice that both subs has (Must Have!) a reference (Btn or Item or something else), even if you don't need that reference in your own code.
If the subs were OnbuttonClick() or OnMenuItemClick(), the code wouldn't work (and give an OLE error as it seems). So you must use OnbuttonClick(Btn) and OnMenuItemClick(Item) instead.
The workaround I posted in the first comment takes care of this (it calls a sub OnMenuItemClick(Item) which then calls something like TheSubWithoutReference() )
Cheers
Steegy
Install latest "GoogleArtFinder.vbs" and "GoogleArtFinder2.vbs" (and add entries to Scripts.ini file)
also put your autostarting code in a file in the Scripts\Auto folder (I call it "GoogleArtToolbarButton.vbs" here)
In "GoogleArtFinder.vbs":
add
Code: Select all
Sub StartAutoArtFinderFromToolbar(TBB)
AutoArtFinder
End Sub
replace
Code: Select all
GoogleArtTBB.OnClickFunc = "AutoArtFinder"
Code: Select all
GoogleArtTBB.OnClickFunc = "StartAutoArtFinderFromToolbar"
ADDITION: Your latest posted code doesn't work for the same reason. Please read my explanation (first comment) again.
If you look to the syntax example for onClickFunc of a SDBButton:
Code: Select all
Sub OnbuttonClick( Btn)
' Some code here
End Sub
Code: Select all
Sub OnMenuItemClick( Item)
' Some code here
End Sub
If the subs were OnbuttonClick() or OnMenuItemClick(), the code wouldn't work (and give an OLE error as it seems). So you must use OnbuttonClick(Btn) and OnMenuItemClick(Item) instead.
The workaround I posted in the first comment takes care of this (it calls a sub OnMenuItemClick(Item) which then calls something like TheSubWithoutReference() )
Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Ah I think I understand, I have added:
and of course change Btn3 to call "SearchCurrent" it works!
For some reason I will have to explore further the toolbar button still does not function.
GoogleArtToolbarButton.vbs
I tried it with and without the "AutoArtFinder" sub.
Code: Select all
Dim Btn3
Set Btn3 = SDB.UI.NewButton(Head)
Btn3.Caption = "Search Selected"
Btn3.Common.Height = 25
Btn3.Common.Width = Head.Common.Width
Btn3.Common.Top = 50
Btn3.UseScript = Script.ScriptPath
Btn3.OnClickFunc = "SearchCurrent"
Sub SearchCurrent(ClickedBtn)
GoogleArtFinder()
End Sub
For some reason I will have to explore further the toolbar button still does not function.
GoogleArtToolbarButton.vbs
Code: Select all
Sub StartAutoArtFinderFromToolbar(TBB)
AutoArtFinder
End Sub
Sub AutoArtFinder
Dim song
Set song = SDB.Player.CurrentSong
If song.Album.AlbumArt is Nothing Then
ArtFinder(song)
End If
Set song = Nothing
End Sub
Sub OnStartup
SDB.UI.AddMenuItemSep SDB.UI.Menu_TbStandard,0,0 'separates the toolbar icon
Dim GoogleArtTBB
Set GoogleArtTBB = SDB.UI.AddMenuItem(SDB.UI.Menu_TbStandard,0,0)
GoogleArtTBB.Caption = SDB.Localize("Google Art Search!")
GoogleArtTBB.IconIndex = 55
GoogleArtTBB.UseScript = SDB.ApplicationPath & "Scripts\GoogleArtFinder.vbs"
GoogleArtTBB.OnClickFunc = "StartAutoArtFinderFromToolbar"
GoogleArtTBB.Shortcut = "Ctrl+G"
End Sub
New script: Last.FM Node Now with DJ Mode!
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
That's my code for "GoogleArtToolbarButton.vbs":
This script is calling the StartAutoArtFinderFromToolbar(Btn) sub in the file SDB.ApplicationPath & "Scripts\GoogleArtFinder.vbs", so the method StartAutoArtFinderFromToolbar(Btn) must be added to the file "Scripts\GoogleArtFinder.vbs" instead of here.
(don't copy sub AutoArtFinder to "Scripts\GoogleArtFinder.vbs" because it's already there and would cause a duplicate error. Just delete sub AutoArtFinder from "GoogleArtToolbarButton.vbs".)
If it still doesn't work, then read the above comments again until it works........(it's all in there ).... or copy/examine the following adapted files:
http://home.tiscali.be/ruben.castelein/ ... Button.vbs (for Scripts folder)
http://home.tiscali.be/ruben.castelein/ ... Finder.vbs (for Scripts\Auto folder)
Cheers
Steegy
Code: Select all
Sub OnStartup
SDB.UI.AddMenuItemSep SDB.UI.Menu_TbStandard,0,0 'separates the toolbar icon
Dim GoogleArtTBB
Set GoogleArtTBB = SDB.UI.AddMenuItem(SDB.UI.Menu_TbStandard,0,0)
GoogleArtTBB.Caption = SDB.Localize("Google Art Search!")
GoogleArtTBB.IconIndex = 1
GoogleArtTBB.UseScript = SDB.ApplicationPath & "Scripts\GoogleArtFinder.vbs"
GoogleArtTBB.OnClickFunc = "StartAutoArtFinderFromToolbar"
GoogleArtTBB.Shortcut = "Ctrl+G"
End Sub
(don't copy sub AutoArtFinder to "Scripts\GoogleArtFinder.vbs" because it's already there and would cause a duplicate error. Just delete sub AutoArtFinder from "GoogleArtToolbarButton.vbs".)
If it still doesn't work, then read the above comments again until it works........(it's all in there ).... or copy/examine the following adapted files:
http://home.tiscali.be/ruben.castelein/ ... Button.vbs (for Scripts folder)
http://home.tiscali.be/ruben.castelein/ ... Finder.vbs (for Scripts\Auto folder)
Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).