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 1401982 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

WSH Panel Mod script discussion/help

Reply #1150
You can check the problem with this simplified code, that should duplicate all elements of the active playlist, but crashes:
Code: [Select]
var pl = plman.ActivePlaylist;
var all_handles = plman.GetPlaylistItems(pl);
plman.InsertPlaylistItems(pl, 0, all_handles);

Error message:
Code: [Select]
[13:51:37] Error: WSH Panel Mod ({8B5414E5-92F3-4BE8-BBB3-A7CF680847A7}): Microsoft JScript runtime error:
Type mismatch
Ln: 3, Col: 1
<source text only available at compile time>

The InsertPlaylistItems() bug seems still present in beta 1, although the error message has changed:
Code: [Select]
[21:02:43] Error: WSH Panel Mod ({8B5414E5-92F3-4BE8-BBB3-A7CF680847A7}): Microsoft JScript runtime error:
Variable uses an Automation type not supported in JScript
Ln: 3, Col: 1
<source text only available at compile time>

WSH Panel Mod script discussion/help

Reply #1151
I still need some help.

I need to call fb.RunMainMenuCommand("Sort by File Path") to sort the whole playlist.  But currently, the function launches the command from the Edit -> Selection -> Sort menu, instead of the same command from the Edit -> Sort menu (probably because WSHPM stops searching the command in the menus as soon as it is found).

Is it a way to specify from which menu the command should be launched?
For example with a path like this:
Code: [Select]
fb.RunMainMenuCommand("Edit/Sort/Sort by File Path");

I know that I can select everything before calling Sort by File Path, but I would prefer to leave the selection unchanged.  Is it possible?

[EDIT]  Forgive me!
Code: [Select]
fb.RunMainMenuCommand("Edit/Sort/Sort by File Path");

It works just as I suggested!

WSH Panel Mod script discussion/help

Reply #1152
For the "thumbs" script, can I get it to show images in the directory from the selected music file, rather than from a specified directory?

Thanks!

WSH Panel Mod script discussion/help

Reply #1153
Code: [Select]
$directory_path(%path%)

WSH Panel Mod script discussion/help

Reply #1154
Excellent, many thanks! Is it possible to enlarge the images by clicking on them? At the moment it only enlarges them within the confines of the panel (which is fairly small). I'd like the ability to view them full size (without having to open containing folder and then click on them again).

Thanks

WSH Panel Mod script discussion/help

Reply #1155
when thumbnails are set to either left or bottom, single clicking the main image opens it in your default external viewer -when in grid mode you can right click and select "open this image".

WSH Panel Mod script discussion/help

Reply #1156
Thanks. I don't get "open this image" - only "open containing folder" (in grid mode).

WSH Panel Mod script discussion/help

Reply #1157
it only works on an enlarged image, not thumbnails.

also, when an image is enlarged, you can scroll using your mouse wheel to save clicking back and forth between thumbnails and enlarged images.

WSH Panel Mod script discussion/help

Reply #1158
I see, thanks! It would be nice to be able to open the image without having to enlarge it first, maybe an option to add to the list

BW

Dan

WSH Panel Mod script discussion/help

Reply #1159
just a note to say my samples now require WSH panel mod 1.5.0 or above.

http://dl.dropbox.com/u/22801321/samples.zip

@danhackley, middle clicking a thumbnail in grid mode now opens it in an external viewer. middle click does not have any affect in any other mode.

WSH Panel Mod script discussion/help

Reply #1160
I searched "amperstamp" but came up empty.

Just wondering where the fault is in parsing the & sign in artist names (and elsewhere). When using scripts which access last.fm or google, the amperstamp and anything after is dropped. So, as an example, Angus & Julia Stone becomes Angus and the wrong band shows up.

WSH Panel Mod script discussion/help

Reply #1161
the term you wanted was ampersandedit: i had a quick google and it seems amperstamp is a genuine term - sorry but i'd never heard of it before.

anyway, you want to be using encodeURIComponent on your variable.

edit2: just uploaded a fix for my samples. some panels would crash with radio streams (this only applies to the new version i uploaded earlier today- previous versions should be fine)

WSH Panel Mod script discussion/help

Reply #1162
Quick question re. the show images in a directory script. When I add more images to the directory, the thumbnails listed do not update. Do I have to do anything to get them to update? Thanks!

WSH Panel Mod script discussion/help

Reply #1163
there wasn't a practical way - you either had to open the editor and close it again or switch to a track with a different artist and back again. but i've just added a "re-scan folder" option to the context menu which should be easier.

WSH Panel Mod script discussion/help

Reply #1164
Marc, I've stolen your InputBox code for one of my scripts, but I can't get it to work properly:
Code: [Select]
var vb = new ActiveXObject('ScriptControl');
vb.Language = 'VBScript';

function InputBox(message, title, value) {
    message = message.replace(/"/g, '" + Chr(34) + "');
    message = message.replace(/\n/g, '" + Chr(13) + "');
    title = title.replace(/"/g, '" + Chr(34) + "');
    value = value.replace(/"/g, '" + Chr(34) + "');
    var temp_value = vb.eval("InputBox" + "(\"" + message + "\", \"" + title + "\", \"" + value + "\")");
    return typeof temp_value == "undefined" ? value : temp_value.trim();
}

val = InputBox("This is a test", "test", "");

The temp_value.trim() instruction crashes with the "Object doesn't support this property or method" error message.  Seems the string returned by vb.eval() is not a regular string object.
However, InputBox() works fine in your autoplaylists script, so I suppose I've missed something in your code (or in common2.js), but I don't know what.  Can you help?

And BTW, have you noticed that InputBox lets you type as many characters as you want, but it silently truncates the string after 254 characters?  It's a real problem with some of my playlists.  For example, the autoplaylist "Related to Hatfield and the North" needs this query (312 characters):
Code: [Select]
ARTIST HAS "Hatfield and the North" OR ALBUM ARTIST HAS "Hatfield and the North" OR COMPOSER HAS "Hatfield and the North" OR PERFORMER HAS "Hatfield and the North" OR COMMENT HAS "Hatfield and the North" OR DISCOGS_ALBUM_CREDITS HAS "Hatfield and the North" OR DISCOGS_TRACK_CREDITS HAS "Hatfield and the North"

Do you know a solution, or is it a VisualBasic limitation?

 

WSH Panel Mod script discussion/help

Reply #1165
add this somewhere. (it's in the common file, you must have missed it)

Code: [Select]
String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g,"");
}


as for your 2nd question, sorry i have no idea. as a workaround, maybe you could just add Hatfield and the North via the input box and have the script build the query to check all those different fields?

WSH Panel Mod script discussion/help

Reply #1166
add this somewhere. (it's in the common file, you must have missed it)

Code: [Select]
String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g,"");
}

Thanks a lot!  Yes, I've missed the prototype.

as for your 2nd question, sorry i have no idea. as a workaround, maybe you could just add Hatfield and the North via the input box and have the script build the query to check all those different fields?

It's exactly what I am doing.  I have a "New 'Related to artist' autoplaylist" menu that duilds the playlist properties automatically.  But if the user wants to edit it after its creation, the InputBox function truncates the query, and the playlist doesn't work any more.

I think I will create a GUI to get the playlist properties with AutoHotkey.  It will need to read and write the arguments to a file (like your old input function did), but at least, there will be a single dialog for all parameters (and I can add "Force-sorted" and the options to add the playlist to the top or bottom of the list, to run it immediately and to remove the dupes in the same dialog).  If you are interested, I can post it here when it will be ready...

WSH Panel Mod script discussion/help

Reply #1167
Thats great thanks marc - what do I need to do to reinstall with that option - just re-load the new script or add other stuff as well? PS any further thoughts on the rear album jewel case?

BW

D

WSH Panel Mod script discussion/help

Reply #1168
just re-importing the script should work in most cases. but if you ever see an error, always extract the marc2003 folder, overwrite the existing files and restart foobar before coming back here to report it.

as for this CD case thing, i'm not sure about it really. my main problem is the fact i have no idea what aspect the images are going to be. with the front it's easy to assume they're all square but i can't do that with the back. call me lazy but i find it hard to get motivated for something i'll never use myself.

@r0lZ, yup i'd be interested in seeing what you do.

WSH Panel Mod script discussion/help

Reply #1169
@r0lZ, yup i'd be interested in seeing what you do.

OK, I will port the dialog and WSH script here, when they will be ready.

BTW, I have a new problem.  I need to parse the file created by the autoplaylist dialog to put the playlist name, query, sort pattern and force-sorted flag in an array.  The file has one line per argument.  That works fine when the sort pattern is not empty, but when it is empty, this code doesn't work:
Code: [Select]
arr = filecontent.split(/\r?\n/g);

The empty line that corresponds to the sort pattern is skipped, the force-sorted flag is stored in arr[2] instead of arr[3] and arr[3] is undefined.
I have never really studied the regular expressions, and I have been unable to modify it to include empty elements in the array.  Can you give me the correct regexpr syntax?

WSH Panel Mod script discussion/help

Reply #1170
No worries marc. If you did consider it, you could assume that the rear covers are standard CD rear jewel case sizes. Maybe even have an option to choose CD (rectangular) or vinyl (square) rear art size.

WSH 1.4.4 is still listed as the current version (you say your scripts now need WSH panel mod v1.5).

WSH Panel Mod script discussion/help

Reply #1171
@r0lZ, you're asking the wrong person. i don't know regex at all. everything used in my scripts was courtesy of mr google.

maybe ReadLine would work?

http://msdn.microsoft.com/en-us/library/h7...v=vs.85%29.aspx

@danhackley, i assume you're looking at the first post in the WSH panel mod thread? just follow the download link and you'll see 1.5.0 beta3 is available.

direct link: http://code.google.com/p/foo-wsh-panel-mod/downloads/list

WSH Panel Mod script discussion/help

Reply #1172
marc, just tried your updated thumbs script. It crashes the window (error "scripting engine initialisation failed  ... CODE 0x80020101).

Is this to do with the WSH panel mod version I have installed? Thanks!

WSH Panel Mod script discussion/help

Reply #1173
@r0lZ, you're asking the wrong person. i don't know regex at all. everything used in my scripts was courtesy of mr google.

maybe ReadLine would work?

http://msdn.microsoft.com/en-us/library/h7...v=vs.85%29.aspx

Yes, ReadLine will certainly work, but split() is so smart! I would prefer it.
Another solution would be to swap the 3rd and 4th arguments.  Only the sort pattern argument can be empty, and it will be easy to check if the last element of the array is undefined.

Thanks anyway.

WSH Panel Mod script discussion/help

Reply #1174
my latest scripts absolutely require 1.5.0 beta3. it's not optional.