WSH Panel Mod script discussion/help. |
![]() ![]() |
WSH Panel Mod script discussion/help. |
Jul 31 2012, 06:32
Post
#1776
|
|
![]() Group: Members Posts: 407 Joined: 26-March 09 Member No.: 68400 |
Neonphytismo, thanks for that reminder!
I actually just saw such an example in the sample scripts, and it made me wonder. But I did not remember reading that warning. |
|
|
|
Jul 31 2012, 13:26
Post
#1777
|
|
|
Group: Members Posts: 30 Joined: 27-January 09 Member No.: 66042 |
QUOTE 3. Don't call repaint functions such as window.Repaint() in callback function on_size() {}, especially in pseudo transparent mode. I've always found that warning odd, because I'm not sure how it ensures the on_size() call happens first and it worries me that on some occasion it might not... Edit: However looking through all my scripts, only the one I glanced it to help trout has on_size() calling Window.Repaint() unnecessarily. I have one other (type of) script which employ this as well - via an intermediate function - so far it seems necessary to this (type of) script, i.e. I took it out and it broke...I'm going to meddle with it a bit more, although my view of the warning is still the same. This post has been edited by rawny: Jul 31 2012, 13:42 |
|
|
|
Aug 16 2012, 17:41
Post
#1778
|
|
|
Group: Members Posts: 276 Joined: 31-December 10 Member No.: 86948 |
I'm trying to tweak a java script to recognize each of the values in multivalue artist tag fields to generate paths to image folders that I've saved:
Currently, the script allows a user to add paths for images, and a user can add as many paths as desired. For example, I've entered the following: C:\\Users\\xxz\\AppData\\Roaming\\foobar2000\\wsh_lastfm\\$crc32(%artist%)\\*.jpg C:\\Users\\xyz\\AppData\\Roaming\\foobar2000\\wsh_lastfm\\$crc32(%artist%)\\*.png (thanks to marc2003 for your script capturing and saving last.fm images that we can use elsewhere, as I'm doing here!) The above entries work well for single value artist tag fields, but currently don't retrieve anything for multivalue artist tag fields (the crc function generates a crc for the string of all the artists in the tag field, and there is no such folder). But most of the time I've got image folders for each of the artists separately and I'd like to add paths to each of those artists, if possible. Is there some kind of loop I could add that would generate the separate paths for each artist in a multivalue artist tag field, and if so what would that look like? Whether the right answer is a loop or not, any suggestions appreciated! |
|
|
|
Aug 20 2012, 16:11
Post
#1779
|
|
![]() Group: Members Posts: 3340 Joined: 27-January 05 From: England Member No.: 19379 |
something like this....
CODE crcs = [];
num = fb.TitleFormat("$meta_num(artist)").EvalWithMetadb(g_metadb) for(i =0; i < num; i++) { crcs[i] = fb.TitleFormat("$crc32($meta(artist," + i + "))").EvalWithMetadb(g_metadb); } |
|
|
|
Aug 21 2012, 05:40
Post
#1780
|
|
|
Group: Members Posts: 276 Joined: 31-December 10 Member No.: 86948 |
Thanks, marc2003 - that code was the key to making it work!
I currently use a crude but effective way to download images for the nth artist for a track: I use your thumbs script and remap the artist field in the context menu to $meta(artist,n) and restart the song to trigger the search and download. If there is a more elegant way to grab images for all artiists for a multivalue artist track, suggestions are appreciated, including any tweaks to put in the thumbs script or common4.js. |
|
|
|
Aug 22 2012, 13:09
Post
#1781
|
|
![]() Group: Members Posts: 3340 Joined: 27-January 05 From: England Member No.: 19379 |
samples updated: http://dl.dropbox.com/u/22801321/samples.zip
i've shamelessly stolen romor's allmusic script from the foo_uie_biography thread. this can display either album reviews or artist bios. the reason i've put this in a WSH panel is because i can support caching which means instant panel updates and offline usage after the initial download of each item. you can also switch between reviews and bios on the fly using the context menu. existing users of my scripts need to extract the marc2003 folder from the zip as it contains a new file required by this script. @godrick, i'll look into it. This post has been edited by marc2003: Aug 22 2012, 13:09 |
|
|
|
Aug 22 2012, 14:12
Post
#1782
|
|
|
Group: Members Posts: 139 Joined: 3-November 11 Member No.: 94918 |
Marc, I'm very grateful for your work. Just tried out your allmusic script - with each and everything I select I get "no text" - I am really sure I copied everything over to the appdata marc2003 folder. The console has no error at all.
Is there something I can do? |
|
|
|
Aug 22 2012, 17:09
Post
#1783
|
|
|
Group: Members Posts: 82 Joined: 27-May 10 Member No.: 80935 |
i've shamelessly stolen romor's allmusic script from the foo_uie_biography thread. Wow thanks for this - you rule... and I'm not just sayin' it. =D It works fine for me - returns results as regularly as the bio panel, however throws up errors occasionally (2 times so far in 10 tracks tested): Error: WSH Panel Mod (Allmusic by marc2003, Uses a modded version of foo_allmusic.vbs by romor): Microsoft JScript runtime error: Invalid procedure call or argument File: <main> Ln: 70, Col: 2 I can't offer more any more details than that yet as to 'causes... UPDATE: Different error: further testing gives me steady script errors for %album artist% "Various Artists" (on albums that exist at Allmusic): line 13; char 7 error Object doesn't support this property or method: 'i.firstchild.firstchild.getAttribute' code 800A01B6 MS VBScript runtime error. This error does not appear for albums that are not at Allmusic. This post has been edited by mjm716: Aug 22 2012, 17:24 |
|
|
|
Aug 22 2012, 19:02
Post
#1784
|
|
|
Group: Members Posts: 149 Joined: 20-September 11 Member No.: 93842 |
marc, how can I edit your .txt file reader to display preformatted text (such as EAC and CUETools logs)?
Thank you for all your work. |
|
|
|
Aug 23 2012, 13:09
Post
#1785
|
|
![]() Group: Members Posts: 3340 Joined: 27-January 05 From: England Member No.: 19379 |
@Emerelle, do you not even see a "fetching info" message for a few seconds? if you see that before the "no text" message, it means the info wasn't found.
also, a limitation of the script is that the album must be on the allmusic site, even in artist bio mode. if there is no album tag, then the script won't run. @mjm716, i've managed to stop the script erroring (extract marc2003 folder again and import the allmusic.txt into your panel) but i can't fix why it won't display various artist albums that do exist. you'll have to ask romor about that. i'm assuming they also fail in the foo_uie_biography panel as well??? @Dario, right click the panel and select "path to text file". use titleformatting to enter the filename. as an example, if the filename is "eac.log" and it sits in the same folder as the playing file then you would use CODE $directory_path(%path%)\eac.log |
|
|
|
Aug 23 2012, 15:48
Post
#1786
|
|
|
Group: Members Posts: 149 Joined: 20-September 11 Member No.: 93842 |
You didn't understand my query (or perhaps I didn't phrase it well).
I'm talking about something like this: CODE [CUETools log; Date: 23/08/2012 02:12:15; Version: 2.1.4] [CTDB TOCID: EbOzQZA2.F7k_wn4ygo8ZQjbXW4-] found. Track | CTDB Status 1 | (3/3) Accurately ripped 2 | (3/3) Accurately ripped 3 | (3/3) Accurately ripped 4 | (3/3) Accurately ripped 5 | (3/3) Accurately ripped 6 | (3/3) Accurately ripped [AccurateRip ID: 000a4a8e-0036c64a-4c09cd06] found. Track [ CRC | V2 ] Status 01 [3c12ca33|d6783547] (2+2/4) Accurately ripped 02 [ed4a2680|68c012ea] (2+2/4) Accurately ripped 03 [5c81b1b1|2a9cc5af] (2+2/4) Accurately ripped 04 [4a491601|508711d5] (2+2/4) Accurately ripped 05 [99538ce0|1aff3f26] (2+2/4) Accurately ripped 06 [24fccfc5|301d2fe3] (2+2/4) Accurately ripped Track Peak [ CRC32 ] [W/O NULL] [ LOG ] -- 97.7 [82DD0EAB] [E0DDA975] CRC32 01 97.7 [FC49B125] [C640A7E7] 02 97.7 [E1E665AD] [94E1D6EE] 03 97.7 [E707FB25] [B2326DDB] 04 97.7 [56C2CF85] [808E4293] 05 64.0 [F18C3285] [EE5A4EDB] 06 97.7 [5C5D1E5E] [2C20C7EA] The whitespaces are preserved and the text is formatted properly, but if I were to just "paste" it, it'd end up being a mess (which is what the .txt reader ends up displaying). This post has been edited by Dario: Aug 23 2012, 15:54 |
|
|
|
Aug 23 2012, 15:50
Post
#1787
|
|
|
Group: Super Moderator Posts: 4483 Joined: 23-June 06 Member No.: 32180 |
Do fixed-width fonts such as Courier New not preserve whitespace when used within the panel?
This post has been edited by db1989: Aug 23 2012, 15:51 |
|
|
|
Aug 23 2012, 15:57
Post
#1788
|
|
|
Group: Members Posts: 149 Joined: 20-September 11 Member No.: 93842 |
Do fixed-width fonts such as Courier New not preserve whitespace when used within the panel? Awesome. They do; but what am I supposed to change the normal_font variable with: CODE gr.GdiDrawText(text_array[i + offset], normal_font, g_textcolor, 6, 16 + (i * row_height), ww - 16, row_height, DT_WORDBREAK | DT_CALCRECT | DT_NOPREFIX); It uses the generic font, in my case, Ubuntu Condensed, which isn't monospaced. I'd like to change it to Ubuntu Mono or Courier New (the latter preferred). This post has been edited by Dario: Aug 23 2012, 15:57 |
|
|
|
Aug 23 2012, 16:50
Post
#1789
|
|
|
Group: Members Posts: 139 Joined: 3-November 11 Member No.: 94918 |
Marc yes I see that message as well - but no info gets displayed even on albums /artists that are on Allmusic (and the tags are intact).
|
|
|
|
Aug 23 2012, 16:53
Post
#1790
|
|
|
Group: Members Posts: 149 Joined: 20-September 11 Member No.: 93842 |
Okay, I figured the way through my issue by myself. Reading the WSH Panel Mod docs can get you a long way. Thank you guys.
|
|
|
|
Aug 23 2012, 19:05
Post
#1791
|
|
|
Group: Members Posts: 139 Joined: 3-November 11 Member No.: 94918 |
Adding examples to my post above:
Joy Division - has text, exactly one match in the artist panel (found straight away using the webbuttons of your samples) Infected Mushroom - also has text, exactly one match, also found through the webbutton from the sample. Still no error in console. Is it possibly incompatible with anything like the other bio panel? PS: Ok, now I got for the first time the very same error like a couple of posts above - error in VB Script etc. It is the same message text as posted above. This post has been edited by Emerelle: Aug 23 2012, 19:07 |
|
|
|
Aug 24 2012, 11:49
Post
#1792
|
|
![]() Group: Members Posts: 3340 Joined: 27-January 05 From: England Member No.: 19379 |
the script searches for the album first and then tries to match the artist so it's no good searching for the artist on it's own. can you give some artist/album combinations to test?
also, if you're seeing script errors, that's not a good sign. but i did mention above that i updated the script so it doesn't display errors anymore. it now fails silently. Different error: further testing gives me steady script errors for %album artist% "Various Artists" (on albums that exist at Allmusic): this is now fixed. the script needs re-importing and the marc2003 folder needs extracting again. http://dl.dropbox.com/u/22801321/samples.zip This post has been edited by marc2003: Aug 24 2012, 12:34 |
|
|
|
Aug 24 2012, 15:17
Post
#1793
|
|
|
Group: Members Posts: 139 Joined: 3-November 11 Member No.: 94918 |
I wasnt aware of an update, your post seemed not modified, I will download that again and report back. I also didnt know I should search for the album first, I will use this advance now.
PS: Ok, now I see the update This post has been edited by Emerelle: Aug 24 2012, 15:18 |
|
|
|
Aug 24 2012, 18:01
Post
#1794
|
|
|
Group: Members Posts: 82 Joined: 27-May 10 Member No.: 80935 |
the script searches for the album first and then tries to match the artist so it's no good searching for the artist on it's own. can you give some artist/album combinations to test? also, if you're seeing script errors, that's not a good sign. but i did mention above that i updated the script so it doesn't display errors anymore. it now fails silently. Different error: further testing gives me steady script errors for %album artist% "Various Artists" (on albums that exist at Allmusic): this is now fixed. the script needs re-importing and the marc2003 folder needs extracting again. http://dl.dropbox.com/u/22801321/samples.zip YES! and YES! thank you so much. I've tried about 50 tracks, and no errors, and I've finally been getting results from 'Various Artists' items - the approximate album name matching seems very robust. Now comes the annoying follow-up wish! [Hopefully that's something I can figure out if you're not interested.] I do have one general question that doesn't make any sense to me. The wsh script uses %album artist% (twice). I've tried changing that to %artist% instead (with the idea for example, that when it retrieves a compilation review, it could simply pull the normal artist bio). However, using %artist% returns no results, for regular albums or compilations (checked against known artists with bios). am I missing something? |
|
|
|
Aug 24 2012, 23:04
Post
#1795
|
|
|
Group: Members Posts: 276 Joined: 31-December 10 Member No.: 86948 |
@mjm716, yes I think you are missing something
The search string in romor's script contains "URL = "http://www.allmusic.com/search/albums/...", for a very good reason if one is looking for both an album review and the right artist bio in one elegant search. So if you want an artist bio not linked to an album search result, you need to do a different search. I think the code you need to borrow is already in the script. For example, consider replacing the "then" portion of of the following "if" statement in the current script: CODE If Lcase(ARG(0)) = "various artists" And ARG(2) = "bio" Then Wscript.Quit() End If to execute a search using an artist search string: CODE URL = "http://www.allmusic.com/search/artists/" & LCase(Replace(ARG(0), " ", "+")) So the "then" portion of the "if" statement above would conduct an artist search. I looked at the web page's source code for such a search result, and I believe you can use the same code as that used to assign artist_link in the current script to find an artist bio, keeping mind that the script will return the first matching search result, which may or may not be the artist you are looking for if it's a common name. Make sure you quit the script at the end of this "then" section, and add an "else" line after your new code and just before the existing code that follows the "if" statement above so that the script continues to work as before for album artists that are not "various artists". This post has been edited by godrick: Aug 24 2012, 23:07 |
|
|
|
Aug 25 2012, 14:32
Post
#1796
|
|
|
Group: Members Posts: 82 Joined: 27-May 10 Member No.: 80935 |
@mjm716, yes I think you are missing something Make sure you quit the script at the end of this "then" section, and add an "else" line after your new code and just before the existing code that follows the "if" statement above so that the script continues to work as before for album artists that are not "various artists". Thanks G - yes, for some reason, the script logic only sinks in briefly and disappears promptly again. One other error to report: If there is no internet connection, it really freaks out - sends many pop-up error reports that makes the app unresponsive. vbs script error: line 34, char 3; system cannot locate the resource specified code 800c0005; source msxml3.dll with no connection, it should be pulling from a saved file if it exists, or otherwise dumping gracefully? ---- thanks for the good work guys! This post has been edited by mjm716: Aug 25 2012, 14:32 |
|
|
|
Aug 25 2012, 14:56
Post
#1797
|
|
![]() Group: Members Posts: 3340 Joined: 27-January 05 From: England Member No.: 19379 |
yesterday i accidentally removed the part that hides popup errors. at the moment line 101 starts like this....
CODE WshShell.Run(script_path.... edit it so it becomes... CODE WshShell.Run("cscript //nologo " + script_path... i hope it doesn't hang in the background when it fails but i have no way to test this as i'm using a computer at my library where i have no control over any settings. |
|
|
|
Aug 25 2012, 15:38
Post
#1798
|
|
|
Group: Members Posts: 254 Joined: 25-September 08 Member No.: 58627 |
marc2003, regarding your Now Playing script...
Depending on the dimensions of the panel, some artist images work quite a lot better than others. And often, one particular image looks just right. Would it be possible to add a function to lock a certain image into place? Or to have the panel remember the last image selected? Alternately, a "delete all but current image" function would work too. I know this can be accomplished manually, but with thousands of artists it would take a bit of time Thanks! |
|
|
|
Aug 25 2012, 22:05
Post
#1799
|
|
|
Group: Members Posts: 82 Joined: 27-May 10 Member No.: 80935 |
i hope it doesn't hang in the background when it fails but i have no way to test this as i'm using a computer at my library where i have no control over any settings. that seemed to fix the no internet pop-ups. however one other bug - if 'allmusic_bio.txt' exists, it's not being read. if (fso.fileExists(filename)) g_text = read(filename); I tested that filename path was correct and file exists = true; but if read is a function, it's missing? This post has been edited by mjm716: Aug 25 2012, 22:09 |
|
|
|
Aug 27 2012, 16:26
Post
#1800
|
|
|
Group: Members Posts: 82 Joined: 27-May 10 Member No.: 80935 |
another strange issue -
the WSH version only displays & saves to allmusic_bio.txt the 1st paragraph from allmusic, while the biography panel displays the whole bio text... =| This post has been edited by mjm716: Aug 27 2012, 16:27 |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th June 2013 - 22:58 |