Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: WSH Panel Mod script discussion/help (Read 1391213 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #3150
Marc, I have a small problem with your script again. 
"Now playing" panel can't automatically re-download artist's biography from both last.fm and wikipedia after I manually deleted folder with artist's information inside "wsh-lastfm" folder. Allmusic reviews can't be re-downloaded sometimes too, but I can use "paste text from clipboard" feature with them now, so its ok. Everything else re-downloads fine for this artist (images,similar artists, top tracks, musicbrainz files). New added artists work perfect as always.
If this re-download issue is intended behavior, can you add "paste text from clipboard" feature for artist's bio too?

WSH Panel Mod script discussion/help

Reply #3151
Marc, I have a small problem with your script again. 
"Now playing" panel can't automatically re-download artist's biography from both last.fm and wikipedia after I manually deleted folder with artist's information inside "wsh-lastfm" folder. Allmusic reviews can't be re-downloaded sometimes too, but I can use "paste text from clipboard" feature with them now, so its ok. Everything else re-downloads fine for this artist (images,similar artists, top tracks, musicbrainz files). New added artists work perfect as always.
If this re-download issue is intended behavior, can you add "paste text from clipboard" feature for artist's bio too?

oops. It actually downloaded now after a day. So maybe it was a problem on server side or there is some kind of timeout for biography downloads  .

WSH Panel Mod script discussion/help

Reply #3152
Quick question if I may please.. pulling hair out

Does anyone have Jscript-WSHPM.xml and Jscript-WSHPM_udl.xml language definition for Notepad++?

A fella on this blog posts said it was on the Notepad mediawiki (which is currently down) but I couldnt find any trace of it on archive.org or even a google search.

Here is the post:
http://p774.blog.fc2.com/blog-entry-26.html

If not, would anyone happen to have one for any other editor? Which editor do you use for code hinting panel mod functions? 

Thanks


Think this is what you're looking for.

Dropbox link

WSH Panel Mod script discussion/help

Reply #3153
I'm trying to make a playlist for a party. Since there's multiple artists I got rid of the group pattern in Falstaff/Br3tt's WSH Playlist.



I'm able to drag the tracks around, but I don't want them to get messed up by any sorting and have to start over again.

Is there a way I can automatically change the track numbers to match how they are ordered in the playlist? I know there's the "auto track number" option when you press tools in the properties dialogue, but since these tracks are just individual songs from different folders, it just names them "1, 1, 1, 1" etc. Is there a component or something I could use to automatically name them in the sequence they are in after drag and dropping them? I know I could export the playlist and have all the tracks in the same folder, and then run the "auto track number" but since I'm constantly adding songs to this playlist I'd have to export it every time I add new tracks.

Is there a better way to create playlists like this?

EDIT:
I just realised that "auto track number" changed the metadata of the track in all the playlists lol. Hmm is there some kind of playlist panel/component that ignores the metadata track number and just allows you to drag the tracks around into their own order? I want to do this without messing with my other playlists.

WSH Panel Mod script discussion/help

Reply #3154
Quick question if I may please.. pulling hair out

Does anyone have Jscript-WSHPM.xml and Jscript-WSHPM_udl.xml language definition for Notepad++?

A fella on this blog posts said it was on the Notepad mediawiki (which is currently down) but I couldnt find any trace of it on archive.org or even a google search.

Here is the post:
http://p774.blog.fc2.com/blog-entry-26.html

If not, would anyone happen to have one for any other editor? Which editor do you use for code hinting panel mod functions? 

Thanks


Think this is what you're looking for.

Dropbox link


Thanks, Perfect.... 

WSH Panel Mod script discussion/help

Reply #3155
oops. It actually downloaded now after a day. So maybe it was a problem on server side or there is some kind of timeout for biography downloads  .


if this happens again, just clear all temporary files from within internet explorer.

WSH Panel Mod script discussion/help

Reply #3156
Is there a way I can automatically change the track numbers to match how they are ordered in the playlist? [...]


Instead of using track numbers in a playlist like this try Index instead. Uncheck the track number column from being displayed and use Index in its place. It will not alter any tags and it will show (act) like a temporary track number and update accordingly to the position in the playlist. Change positions by dragging the index number of the file to wherever you want it in the playlist.

WSH Panel Mod script discussion/help

Reply #3157
Is there a way I can automatically change the track numbers to match how they are ordered in the playlist? [...]


Instead of using track numbers in a playlist like this try Index instead. Uncheck the track number column from being displayed and use Index in its place. It will not alter any tags and it will show (act) like a temporary track number and update accordingly to the position in the playlist. Change positions by dragging the index number of the file to wherever you want it in the playlist.


That's just what I was looking for, thank you so much.

WSH Panel Mod script discussion/help

Reply #3158
Quick question if I may please.. pulling hair out

Does anyone have Jscript-WSHPM.xml and Jscript-WSHPM_udl.xml language definition for Notepad++?

A fella on this blog posts said it was on the Notepad mediawiki (which is currently down) but I couldnt find any trace of it on archive.org or even a google search.

Here is the post:
http://p774.blog.fc2.com/blog-entry-26.html

If not, would anyone happen to have one for any other editor? Which editor do you use for code hinting panel mod functions? 

Thanks


Think this is what you're looking for.

Dropbox link


Oh man 1000 thank you very muches

WSH Panel Mod script discussion/help

Reply #3159
I want to insert within WSH a playlist item(s)  from one playlist (b) to another playlist (a) , but into the item's same position(index)  in playlist (a) which gets removed.

With this code the new entries are added to the end.
Code: [Select]
//target playlist
var a = plman.ActivePlaylist;
var idxa = plman.GetPlaylistFocusItemIndex(a);
plman.RemovePlaylistSelection(a);

//source playlist
playlist_name = "b";

var idxp = -1;

    // Find the playlist first.
    for (var i = 0; i < fb.PlaylistCount; ++i)
    {
        if (fb.GetPlaylistName(i) == playlist_name)
        {
            idxp = i;
            break;
        }
    }

    // Switch to the playlist
    fb.ActivePlaylist = idxp;

//copy items to target

var srcIndex = plman.ActivePlaylist;
   
if (srcIndex < 0) return;
   
    var items = plman.GetPlaylistItems(srcIndex);
           
    plman.InsertPlaylistItems(a, 0, items);      <------------Want to insert new items starting at index idxa
    plman.ActivePlaylist = a;
   
    items.Dispose();


Is it possible??

WSH Panel Mod script discussion/help

Reply #3160
From the docs:

plman.InsertPlaylistItems(playlistIndex, base, handles, select = false);

So the second item specifies the position & the below ought to work so long as the rest of your code is correct.

Code: [Select]
plman.InsertPlaylistItems(a, idxa, items);

WSH Panel Mod script discussion/help

Reply #3161
From the docs:

plman.InsertPlaylistItems(playlistIndex, base, handles, select = false);

So the second item specifies the position & the below ought to work so long as the rest of your code is correct.

Code: [Select]
plman.InsertPlaylistItems(a, idxa, items);


Thanks for verifying,

I had read the docs , and I guessed that base was the index but I had a  typo in my code.
Works now 

WSH Panel Mod script discussion/help

Reply #3162
One question for Marc or other who know..
I have windows xp professional(version 2002 , service pack 2) on my work, and i'm set to listen Foobar Youtube Radio , everything works, but can't open input box from WSH, here's code i'm use:

Code: [Select]
//Input Box    
    this.InputBox = function(prompt, title, value) {
    prompt = prompt.replace(/"/g, '" + Chr(34) + "').replace(/\n/g, '" + Chr(13) + "');
    title = title.replace(/"/g, '" + Chr(34) + "');
    value = value.replace(/"/g, '" + Chr(34) + "');
    var temp_value = this.vb.eval('InputBox' + '("' + prompt + '", "' + title + '", "' + value + '")');
    if (typeof temp_value == "undefined") return value;
    if (temp_value.length == 254) this.MsgBox("Your entry was too long and will be truncated.\n\nSee the WSH panel mod script discussion thread on hydrogenaudio forums for help.", 0, "Youtube Radio");
    return temp_value.trim();
    }

this.vb = new ActiveXObject("ScriptControl");
this.vb.Language = "VBScript";
this.artist = "%artist%";




I have error on this:
Code: [Select]
this.vb = new ActiveXObject("ScriptControl");
this.vb.Language = "VBScript";
this.artist = "%artist%";


Console:

Code: [Select]
Scripting Engine Initialization Failed (Youtube Radio by Mire777, CODE: 0x80020101)
Check the console for more information (Always caused by unexcepted script error).


Error: WSH Panel Mod (Youtube Radio by Mire777): Microsoft JScript runtime error:
Automation server can't create object
File: <main>
Ln: 395, Col: 2
<source text only available at compile time>


What is the problem?
Did i have to install some support for windows xp , is this possible?

WSH Panel Mod script discussion/help

Reply #3163
Quote
Automation server can't create object


this error usually means you haven't turned off safe mode in the WSH panel mod preferences (under tools).

i'm cursed with using XP at the moment and all my scripts using the input box function work just fine. i'm running SP3 though. i don't know if this makes any difference or not.

if the script still crashes on theses lines of code, you can comment them out.

Quote
this.vb = new ActiveXObject("ScriptControl");
this.vb.Language = "VBScript";


then you can hold shift when you right click the script and select properties. here you can change variables and all my scripts with an editable artist string have a value named artist_tf - or you can edit the script itself.

WSH Panel Mod script discussion/help

Reply #3164
this error usually means you haven't turned off safe mode in the WSH panel mod preferences (under tools).

i'm cursed with using XP at the moment and all my scripts using the input box function work just fine. i'm running SP3 though. i don't know if this makes any difference or not.


No, safe mode is turned off.
I think this is because of SP2.
I was also try your thumbs script with same line, and it crashes right there.

Console:
Code: [Select]
Error: WSH Panel Mod (Thumbs by marc2003): Microsoft JScript runtime error:
Automation server can't create object
File: C:\Program Files\STUFF\foobar2000\marc2003\common7.js
Ln: 1396, Col: 2
<source text only available at compile time>



if the script still crashes on theses lines of code, you can comment them out.


For now i was excluded this line from script, and script works fine, but..
Why is this happening?

WSH Panel Mod script discussion/help

Reply #3165
Quote
Why is this happening?


i think you've already answered your own question....

Quote
I think this is because of SP2.


i know my scripts work on a totally naked SP3 install with no other updates installed. i can't test an earlier version myself because SP3 is integrated into my install disk. you should install SP3 or maybe find the changelog that details which update you need to install. but doing that might be easier said than done..... 

WSH Panel Mod script discussion/help

Reply #3166
i know my scripts work on a totally naked SP3 install with no other updates installed. i can't test an earlier version myself because SP3 is integrated into my install disk. you should install SP3 or maybe find the changelog that details which update you need to install. but doing that might be easier said than done..... 


Thank you..
Then i must download and install Service Pack 3.

WSH Panel Mod script discussion/help

Reply #3167
i hope installing SP3 works out for you. if it doesn't, i really can't think what else it could be.

as you can see here, it just works for me....


WSH Panel Mod script discussion/help

Reply #3168
i hope installing SP3 works out for you. if it doesn't, i really can't think what else it could be.

as you can see here, it just works for me....


I see, thanks..
Maybe is something messed up even in OS, i found update for this, but don't know , if i'm gonna do this, i'm afraid that something goes wrong..
I'll probably just modify the script and set input box in panel..
Thank God i'm using windows 7 on home

WSH Panel Mod script discussion/help

Reply #3169
Marc (or anyone else), do you think it would take a lot of work to create a script to list all cover arts from the currently highlighted playlist in a gridlike fashion?

Currently I'm using foo_uie_graphical_browser for this purpose, but it seems to freeze foobar until all covers are loaded, which, in case of large playlists becomes a problem. Es/ELPlaylist are simply extremely slow to load them in my experience.

The point is to identify albums (therefore folders) with missing external cover art by simply looking at the blank spaces in the list of covers. Location is always $directory_path(%path%)\cover.* (next to the tracks). Clicking on a cover art (even if blank) should open the directory of said path. Not sure if possible, but disabling the scrollbar would be highly preferred. Giving a colorized border to highlighted or currently playing album would be a bonus but not important.

http://i.imgur.com/ou4Sbch.png

Above is how I have it currently. It's that vertical because it goes along the side of an actual playlist. The blank in the middle is the album without cover art. The one with orange border is the currently playing album and the blue is the currently highlighted.

WSH Panel Mod script discussion/help

Reply #3170
i know falstaff made a script that displays all covers for the current playlist. i don't use it though so i have no idea what performance is like with large playlists.

http://pastebin.com/TTxyjjcQ

edit: thinking about this from a completely different angle, this album art download XUI program can interface with foobar and i will list albums with missing art. you can search by library or select a playlist.

i've just tested it and you can see from this screenshot what it is capable of.



program: http://www.hydrogenaud.io/forums/index.php?showtopic=57392
required foobar component: http://www.hydrogenaud.io/forums/index.php?showtopic=39946

WSH Panel Mod script discussion/help

Reply #3171
Is it possible to create a WSH panel for lastFm similar tracks
I tried using track.getSimilar methoed but got this error in console :Track not found

WSH Panel Mod script discussion/help

Reply #3172
Falstaff's script shows that in terms of performance WSH is definitely the way to go. I have problems with it aesthetically (minimum window size is too big, the cover selected is always centered) which I can hopefully hack for my taste given some time.

I knew about Album Art Downloader, however for me the aim in the current situation is to have an immediate idea of what albums are missing covers by a simple glance with the least amount of input required. The program does pretty much the same thing, it's just one more click away. Also I think it can't discern between embedded and external artwork (in terms of actually letting me select only the ones with one or the other, not just show it), but I could be wrong on that.

WSH Panel Mod script discussion/help

Reply #3173
Is it possible to create a WSH panel for lastFm similar tracks
I tried using track.getSimilar methoed but got this error in console :Track not found


yes, this should be possible. i just checked the example links on the docs page and they work as expected. did you start your own script from scratch or are you modifying something created by someone else?

2 things you must pay attention to is that you pass all the required parameters as part of the url you supply and that you check and parse the response correctly. if using JSON, it's returned in a pretty much un-readable wall of text so you can either use a website that will format it nicely so you can analyse the structure or use a decent text editor like notepad++ and the jstool plugin.

WSH Panel Mod script discussion/help

Reply #3174
Is it possible to create a WSH panel for lastFm similar tracks
I tried using track.getSimilar methoed but got this error in console :Track not found

yes, this should be possible. i just checked the example links on the docs page and they work as expected. did you start your own script from scratch or are you modifying something created by someone else?

2 things you must pay attention to is that you pass all the required parameters as part of the url you supply and that you check and parse the response correctly. if using JSON, it's returned in a pretty much un-readable wall of text so you can either use a website that will format it nicely so you can analyse the structure or use a decent text editor like notepad++ and the jstool plugin.

Actually I modified your code marc2003 
Im trying to do this by editing your similar artist script
I just edited the cmmon7.js files 2449 line as this :
Code: [Select]
url = l.get_url() + "&method=" + this.lastfm_methods[this.lastfm_mode] +  "&artist=" + encodeURIComponent(this.artist) + "&track=" + encodeURIComponent(this.track) + "&autocorrect=" + (l.auto_correct ? 1 : 0);
and i changed lastfm_mode : artist.getSimilar  to track.getSimilar
artist HAS to title HAS in line 2284
I thought it would work but it gives the error: Last.fm Similar Artists: Track not found
I'm kinda new to programming so I'll be very thankful if you help me out