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 1399893 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #3175
there is so much more work to do than changing that one line of code.   

there is even a lot more to do than the 2 things i outlined in my previous post. at the moment, my similar artists script only triggers on an artist change but it needs to trigger on a track change and you must consider a whole new file naming scheme for the cached data. at the moment, it stores one file artist as that is all it currently needs. when you've considered how do detect track changes/save the data, you need figure out how to parse the response - that's something i mentioned previously about working with JSON. track.getsimilar will have a different internal structure to artist.getsimilar. i expect only minor changes would be required but the current code will ignore it.

tbh, it might be easier if i just did it myself. i might take a look over the next few days. 

WSH Panel Mod script discussion/help

Reply #3176
It's been awhile since I switched to a Mac and... you guessed it, I am missing foobar2000.
Long back, I had made my own foobar2000 theme which I recently converted to an app using WineBottler.
The task was fairly simple. Everything works fine except for 3 WSHMod panel scripts.

One of them is a simple script that lets me cycle through different playback orders.
The error i get on this is:
Quote
Scripting Engine Initialization Failed (Playback Order Button, CODE: 0x80004001): Unknown error code (2147500033)

Maybe I need to modify my WineBottler settings to include some crucial dll file (maybe?).

The WSHMod panel script goes like this:

Code: [Select]
//...
window.MinWidth = window.MaxWidth = 27;
window.MinHeight = window.MaxHeight = 20;

var path = fb.ProfilePath + "exdb\\Buttons\\PBO\\";
var PBO;
var icon;

checkPBO();

function checkPBO(){
    PBO = fb.PlayBackOrder;
    icon = gdi.Image(path + "pbo_" + PBO + ".png");
}

//... code continues but irrelevant


Bascially, It screws up when
Code: [Select]
gdi.Image
comes into the picture.
Would anyone be kind enough to shed some light on this. What is needed to support this?

Like, what are it's dependencies? ...something like that

WSH Panel Mod script discussion/help

Reply #3177
i've only ever used WINE on ubuntu linux (many years ago ) so i have no idea if this works on a mac but i assume you have winetricks available?

if so, try installing these packages

gdiplus
wsh56

i also installed these because my scripts needed internet access but you might not need them??

winhttp
wininet
ie8

WSH Panel Mod script discussion/help

Reply #3178
i've only ever used WINE on ubuntu linux (many years ago ) so i have no idea if this works on a mac but i assume you have winetricks available?

if so, try installing these packages

gdiplus
wsh56

i also installed these because my scripts needed internet access but you might not need them??

winhttp
wininet
ie8
aah, some direction.
thanks marc2003

i am not so good with winetricks. it just confuses me  but now that you mentioned it, i'll try those out.

PS: One of those 3 malfunctioning scripts is your amazing last.fm script. Hopefully that'll start working as well.
Thanks,

WSH Panel Mod script discussion/help

Reply #3179
tbh, it might be easier if i just did it myself. i might take a look over the next few days. 


i quickly cobbled something together but i won't release it just yet. i think some more testing is required.

one thing i have noticed is that the cached data files using this track.getSimilar are much larger than from other feeds (around 300-400KB). when you combine that with the fact you're fetching a new file for every track rather than one per artist, the size of the cached data could build up rather quickly - say 4-5MB for a normal length album.

WSH Panel Mod script discussion/help

Reply #3180
@samithaj, i'm not particularly happy about the amount of bandwidth/storage space this track.getSimilar script uses so i'm not making it part of my main download. i have uploaded it here for you try it out if you want to....

https://dl.dropboxusercontent.com/u/2280132...ilar/common7.js << save this in your marc2003 folder when foobar is not running.

additionally, for it to properly display the track title in the panel header area, you'll need to import this file into your panel.

https://dl.dropboxusercontent.com/u/2280132...r%20artists.txt

it's a modification of my existing similar artists script and you can switch to similar tracks using the right click menu.

edit: why not have a screenshot as well...


WSH Panel Mod script discussion/help

Reply #3181
Big thanks to marc 2003 providing a working script  .It very premature of me to think that script will work just by changing 2 lines of code : 
I think adding (limit (Optional) : Maximum number of similar tracks to return) parameter will reduce cached data size
I use your awesome  scripts in my foobar and they are very usefull, again thanks!!!

WSH Panel Mod script discussion/help

Reply #3182
i've only ever used WINE on ubuntu linux (many years ago ) so i have no idea if this works on a mac but i assume you have winetricks available?

if so, try installing these packages

gdiplus
wsh56

i also installed these because my scripts needed internet access but you might not need them??

winhttp
wininet
ie8
Awesome!!

I used the winetricks you suggested and it now renders 2 of the 3 WSHmod scripts.
Your script still shows no sign of life.

Anyways, it solved one major issue of not exiting properly but it brought up a new major issue.
The foobar volume control won't work

It worked before any winetricks

Any ideas what to do?

In the meantime I try different sets of those winetricks to see which is most optimized for me.

EDIT:
Ok, i recreated using only WSH56js, gdiplus_winxp and winxp
All good but your script is still crashing.

What all dependencies would your script technically need?
As I stated earlier, I had tried winhttp, wininet and ie8 and it still hadn't worked.

Sql somethings?

WSH Panel Mod script discussion/help

Reply #3183
I think adding (limit (Optional)


blindingly obviously. that's why i didn't think of it.  i'm sure you can make that change yourself. you found the right line of code before so just add something like &limit=25

@matav, i'm pretty sure i had my last.fm playcount script working with just those things i've already listed. i know when i used ubuntu, i had to make sure sqlite3.exe file inside the marc2003 folder was executable. i just right clicked the file>properties in whatever file manager i was using. as it's a basic command line program, there are no other dependencies.

as for the "crashing", i assume when you're getting the harmless blue background with the "aw crashed " message? you need to read the dialog as it tells you to look at the foobar console. this gives great clues such as the line number containing the errant code or other helpful error messages. i can't diagnose problems without the details.

WSH Panel Mod script discussion/help

Reply #3184
...
@matav, i'm pretty sure i had my last.fm playcount script working with just those things i've already listed. i know when i used ubuntu, i had to make sure sqlite3.exe file inside the marc2003 folder was executable. i just right clicked the file>properties in whatever file manager i was using. as it's a basic command line program, there are no other dependencies.

as for the "crashing", i assume when you're getting the harmless blue background with the "aw crashed " message? you need to read the dialog as it tells you to look at the foobar console. this gives great clues such as the line number containing the errant code or other helpful error messages. i can't diagnose problems without the details.
whoops, my bad.

I forgot that the console is a bit more descriptive than simply
Code: [Select]
Scripting Engine Initialization Failed (Last.fm Playcount Sync by marc2003, CODE: 0x80020101)
Check the console for more information (Always caused by unexcepted script error).

the error is:
Code: [Select]
Error: WSH Panel Mod (Last.fm Playcount Sync by marc2003): Microsoft JScript runtime error:
Automation server can't create object
File: C:\winebottler\marc2003\common4.js
Ln: 398, Col: 1

the version of your script that I have has this at line 398:
Code: [Select]
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

WSH Panel Mod script discussion/help

Reply #3185
news about wsh panel mod --
theophile stopped developing wsh panel mod for a long time, while now ttsping start to dev a mod version named wsh-panel-mod-plus, simillar to wsh-panel-mod-sp(by neon), anybody interested ?

Code: [Select]
//窗口风格 详见http://msdn.microsoft.com/en-us/library/windows/desktop/ms632600%28v=vs.85%29.aspx
//扩展窗口风格 详见http://msdn.microsoft.com/en-us/library/windows/desktop/ff700543%28v=vs.85%29.aspx


interface IWindow{
Properties:
  (read,write) Left;//窗口左坐标
  (read,write) Top;
  (read,write) Width;
  (read,write) Height;
  (read,write) Style; //窗口风格
  (read,write) ExStyle;//窗口扩展风格
  (read,write) Caption;//窗口标题
Methods:
IWindow GetChild(class_name,index);//获取类名为class_name的第index个面板
//flag=1 同GetParent
//flag=2 获取根窗口句柄
//详见 [url=http://msdn.microsoft.com/en-us/library/windows/desktop/ms633502%28v=vs.85%29.aspx]http://msdn.microsoft.com/en-us/library/wi...v=vs.85%29.aspx[/url]
IWindow GetAncestor(flag = 1);
void SetParent(IWindow parent);
void SendMsg(msg,wp,lp);
//详细及flag见 [url=http://msdn.microsoft.com/en-us/library/windows/desktop/ms633548%28v=vs.85%29.aspx]http://msdn.microsoft.com/en-us/library/wi...v=vs.85%29.aspx[/url]
void Show(flag);
void Move(x,y,w,h,redraw = false);
boolean IsVisible();
boolean IsMinimized();
boolean IsMaximized();
//vista+
//mode = 0时,l t r b对应左/上/右/底边距
//mode = 1时,对应点(l,t)与(r,b)为左上/右下的矩形区域
void CreateGlass( l, r, t , b, mode = 0);
//color 透明色
void SetWindowTransparency(opacity,color);
int MsgBox(caption,prompt,type);
String InputBox(caption="",prompt="",defval="",num_only = false);
//mode:
// 0 打开文件 1 保存文件 2 打开目录
// 打开目录时,参数除title 其他忽略
String FileDialog(mode = 0,title="Open",filetype="All Files|*.*",defext="*");
IGdiBitmap PrintWindow(client_only = false);
}

interface IPrivateFontCollection{
Properties:
(readonly) FamilyCount;
Methods:
int AddFont(path);
IGdiFont GetFont(name,size,style);
}

//实验性质
interface IHttpRequest{
Methods:
    void AddHeader(str);
    void AddPostData(name,value);
    String Run(url);
    int RunAsync(url);//异步url请求,返回cookie值,完成后调用on_http_run_done(cookie,string);
}

interface WSHUtils{
Methods:
IWindow GetWND(class_name);
IWindow CreateWND(window_id);
IWindow ReleaseCapture();
boolean IsAeroEnabled();
IGdiBitmap DecodeBase64Image(str);
String GetClipboardText();
void SetClipboardText(str);
void PlaySound(path,flag);
HCURSOR LoadCursorX(path);
HCURSOR SetCursorX(handle);
void ReleaseCursorX(handle);
boolean IsVistaOrGreater();
//详见http://msdn.microsoft.com/en-us/library/windows/desktop/dd318700%28v=vs.85%29.aspx
String LCMapString(str,lcid,flag);
//type_str:
//"GET"
//"POST"
IHttpRequest CreateHttpRequest(type_str);
VBArray GetWindowsVersion();
}

interface IThemeManager {
Methods:
//Vista+
void DrawThemeTextEx(IGdiGraphics, text, color, x, y, w, h, iGlowSize = 5 , format = 0);
}

interface IGdiUtils {
Methods:
//返回值0:成功
int AddFontResEx( path,fl=0);
//fl必须与AddFontResEx中的值相同
int RemoveFontResEx( path,fl=0);
IPrivateFontCollection CreatePrivateFontCollection();
IGdiBitmap CloneGraphics(IGdiGraphics,x,y,w,h);
}

interface IGdiGraphics{
Methods:
  void FillPie(x,y,w,h,start_angle,sweep_angle,color);
  void DrawPie(x,y,w,h,start_angle,sweep_angle,color);
}

interface IFbPlaylistManager {
Methods:
  string PlaylistGetAutoName(playlistIndex);//自动获取播放列表名称(根据列表曲目)
  //锁定播放列表
  //FLAGs:
  //FLAG_ADD = 0x00000001
  //FLAG_REMOVE = 0x00000002
  //FLAG_REORDER  = 0x00000004
  //FLAG_REPLACE  = 0x00000008
  //FLAG_RENAME = 0x00000010
  //FLAG_REMOVE_PLAYLIST = 0x00000020
  void PlaylistLock(playlistIndex,flag);
  //注:锁定后的播放列表index更改后,请使用更改后的new_index进行unlock
  void PlaylistUnlock(playlistIndex);
  void ProcessLocationsAsync(urls);//完成后调用on_process_locations_done(metadbs)
}

//improve
interface IFbTitleFormat {
Methods:
    //对于foobar2000 v1.3.0 以上,请注意fromfile参数
    String Eval(force = false,fromfile = false);
    String EvalWithMetadb(IFbMetadbHandle,fromfile = false);
    void Dispose();
}

interface IFbMetadbHandle {
Methods:
    //对于foobar2000 v1.3.0 以上,请注意参数
    IFbFileInfo GetFileInfo(fromfile = false);
    void UpdateFileInfo(IFbFileInfo,force = false);
}

interface IFbUtils {
Methods:
    boolean IsMediaLibraryEnabled();
    IFbMetadbHandleList GetAllItemsInMediaLibrary();
    //query_string同媒体库搜索
    IFbMetadbHandleList QueryMulti(handles,query_string);
    //返回菜单命令项状态flag,如选中、禁用等
    //flag_disabled = 1
    //flag_checked = 2
    //flag_radiochecked = 4
    int GetMainMenuCommandStatus(command);
    void ShowPreferences(guid_str="");
    boolean LoadPlaylistV2(path);
    boolean SavePlaylistV2(path,handles,overwrite = false);//当overwrite=true时,将备份原文件为"原播放列表文件名.bak"
}

interface IWSHUtils {
Methods:
    //输出设置页面GUID至控制台
    void PrintPreferencePageGUID();
    //pattern: 设置项-显示-封面模板方式,即按行分割,e.g.  "c:\\%album%.jpg\ncover.jpg";
    IGdiBitmap GetAlbumArtV3(metadb, pattern , art_id = 0, need_stub = true, load_embed = true , use_fallback = true);
}
A rose will bloom, it then will fade.

WSH Panel Mod script discussion/help

Reply #3186
Automation server can't create object


and you definitely have safe mode disabled under tools>preferences>wsh panel mod.

open a brand new panel with no code in it, paste in this section and see if it will load all these without crashing....

Code: [Select]
var WshShell = new ActiveXObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var vb = new ActiveXObject("ScriptControl");
vb.Language = "VBScript";


if it does work but then crashes if you add the xmlhttp line, then we know there is come kind of problem with the wine configuration. how to fix that, i would have no idea?? i know it worked for me on ubuntu/wine because it is absolutely necessary for all my scripts that fetch info from the internet and i have a whole bunch of those.

i assume when you used winetricks, you didn't get any errors and everything appeared to install correctly? for example, with ie8, you should see the full GUI installer like you get running the setup program on windows xp.

WSH Panel Mod script discussion/help

Reply #3187
Automation server can't create object
and you definitely have safe mode disabled under tools>preferences>wsh panel mod.
yes, "safe mode" is unchecked. ain't it meant to be disabled?

----
open a brand new panel with no code in it, paste in this section and see if it will load all these without crashing....
Code: [Select]
var WshShell = new ActiveXObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var vb = new ActiveXObject("ScriptControl");
vb.Language = "VBScript";
Crashed with the following:

Quote
Scripting Engine Initialization Failed ({D157A5FE-9B29-4F57-B2EC-6D4D046BDB04}, CODE: 0x80020101)
Check the console for more information (Always caused by unexcepted script error).
Code: [Select]
Error: WSH Panel Mod ({A587D636-7EA4-4AF2-BE88-744A30E6C055}): Microsoft JScript runtime error:
Automation server can't create object
File: <main>
Ln: 3, Col: 1
something related to VB ...maybe?

----
if it does work but then crashes if you add the xmlhttp line, then we know there is come kind of problem with the wine configuration.
i forgot to mention but i got this error fixed by including the `msxml3` winetrick.

----
i assume when you used winetricks, you didn't get any errors and everything appeared to install correctly? for example, with ie8, you should see the full GUI installer like you get running the setup program on windows xp.
yes, but ie8 disables foobar's inbuilt volume control and messes with the folder structure a bit so I ditched it for ie6.

----
The winetricks I think are going good for me are: gdiplus_winxp, msxml3, wsh56js, winhttp, wininet, ie6, winxp

I have noticed that out of the 3 wsh winetricks available: wsh56js (js only), wsh56vb (vb only) & wsh57, only wsh56js works.

----
sorry for the long, troubling post, marc

the current status is:
Code: [Select]
Error: WSH Panel Mod (Last.fm Playcount Sync by marc2003): Microsoft JScript runtime error:
Automation server can't create object
File: C:\winebottler\marc2003\common4.js
Ln: 400, Col: 1
line 400 has:
Code: [Select]
var vb = new ActiveXObject("ScriptControl");

WSH Panel Mod script discussion/help

Reply #3188
as you're using a very old version of my script, stick with that. it's just newer versions of my scripts that require ie8.

as for the vb thing not working - it doesn't matter. just comment out those 2 lines like this.

Code: [Select]
//var vb = new ActiveXObject("ScriptControl");
//vb.Language = "VBScript";


make sure you don't trigger the option to set your last.fm username via the right click menu because that relies on the above code.

if you're using a portable version of foobar that was previously setup with your last.fm username then it should just work. that means there should be a file named username (no extension) inside a folder named wsh_settings. if it's not there, you can create it manually using notepad - the content of the file should obviously be your username.

i'll await the next report because something else is bound to go wrong.

WSH Panel Mod script discussion/help

Reply #3189
...
as for the vb thing not working - it doesn't matter. just comment out those 2 lines like this.

Code: [Select]
//var vb = new ActiveXObject("ScriptControl");
//vb.Language = "VBScript";
It works now o_O Thank you so much! \o/

make sure you don't trigger the option to set your last.fm username via the right click menu because that relies on the above code.
aye-aye, it does crash if i use those options

if you're using a portable version of foobar that was previously setup with your last.fm username then it should just work. that means there should be a file named username (no extension) inside a folder named wsh_settings. if it's not there, you can create it manually using notepad - the content of the file should obviously be your username.
it seems that I'll have to manually create the file, which... i did but what about the API key? I have it but how do I specify it? and... got api_key set as well.

but... now what? it shows the exclamation with the tooltip reading:
Quote
Please use the context menu to set your Last.fm username and API KEY.
I did my primitive debugging and this case executes
Code: [Select]
case username.length == 0:
so, it would seem that the following doesn't work:
Code: [Select]
var username = read(username_file);
----
marc, thank you so much for your help. you have no idea how much i appreciate it.

WSH Panel Mod script discussion/help

Reply #3190
so, it would seem that the following doesn't work:
Code: [Select]
var username = read(username_file);


it uses this bit of code i posted earlier...

Code: [Select]
var fso = new ActiveXObject("Scripting.FileSystemObject");


this seems to load with crashing the panel but for whatever reason it's not working. maybe some other dependency? but seeing as you can edit the script directly, it's not important.

WSH Panel Mod script discussion/help

Reply #3191
@marc2003 Is there a way to point all Last.fm Similar Artists panal's Autoplaylist links to same playlist rather than creating a new plalist every time i click on a link

WSH Panel Mod script discussion/help

Reply #3192
...
but seeing as you can edit the script directly, it's not important.
ok, so i hardcoded my username and api key into the script and the heart appears now but "Create and import SQL file" doesn't work and neither does pressing the love button.

Both crash with the same error:
Quote
Error: WSH Panel Mod (Last.fm Playcount Sync by marc2003): Microsoft JScript runtime error:
Exception thrown and not caught
File: C:\winebottler\marc2003\common4.js
Ln: 374, Col: 1
<source text only available at compile time>
line 374 has:
Code: [Select]
throw new SyntaxError('JSON.parse');};}}());

and... the whole block would be, as you already know, but still:
Code: [Select]
var JSON;if(!JSON){JSON={};}
(function(){'use strict';function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());

 

WSH Panel Mod script discussion/help

Reply #3193
@samithaj, it's not possible to re-use an autoplaylist but when using a fixed name, it's possible to delete old ones first before creating a new one. obviously you'd want a playlist name that won't conflict with anything else. open the panel, scroll to the end and replace the entire last function with this....

Code: [Select]
function on_mouse_lbtn_up(x, y) {
switch(true) {
case li.up_btn.lbtn_up(x, y):
case li.down_btn.lbtn_up(x, y):
break;
case li.in_range && x > li.x + li.text_x && x < li.x + li.text_x + Math.min(li.names_widths[li.index], li.text_width):
switch(true) {
case li.lastfm_mode != 2 && li.lastfm_link == "autoplaylist":
var i = 0;
while(i < fb.PlaylistCount) {
if (fb.GetPlaylistName(i) == "Last.fm Similar") fb.RemovePlaylist(i);
else i++;
}
fb.CreateAutoPlaylist(fb.PlaylistCount, "Last.fm Similar", li.queries[li.index]);
fb.ActivePlaylist = fb.PlaylistCount - 1;
break;
default:
p.browser(li.urls[li.index]);
break;
}
break;
}
}

@matav, i actually didn't realise my scripts in the old common4.js file used JSON. this is why i thought it would work - i even said that newer scripts require ie8 in WINE because i knew about this crash in that block of JSON code. ie8 actually updates the windows scripting host components with native JSON support without the need for that code. it gets bypassed if it's detected. the reason that code is in my common file is for people running windows XP with IE6/7 where of course it works perfectly.

obviously, that code has nothing to do with me but i've looked at the site i originally got it from and it has been updated since i last checked so it might now magically work but i wouldn't hold your breath. trying to use the code with windows scripting host on a mac is not exactly a common usage scenario.

you can check it out here: https://github.com/douglascrockford/JSON-js...master/json2.js

WSH Panel Mod script discussion/help

Reply #3194
...
@matav, i actually didn't realise my scripts in the old common4.js file used JSON. this is why i thought it would work - i even said that newer scripts require ie8 in WINE because i knew about this crash in that block of JSON code. ie8 actually updates the windows scripting host components with native JSON support without the need for that code. it gets bypassed if it's detected. the reason that code is in my common file is for people running windows XP with IE6/7 where of course it works perfectly.

obviously, that code has nothing to do with me but i've looked at the site i originally got it from and it has been updated since i last checked so it might now magically work but i wouldn't hold your breath. trying to use the code with windows scripting host on a mac is not exactly a common usage scenario.

you can check it out here: https://github.com/douglascrockford/JSON-js...master/json2.js
dang, seems like I hit a brick wall.
I tried the updated code as in that git and it was the same error.
 

Anyways... I'll peruse through the code and try to figure something out ...with my shady debugging skills
As per the comment, that exception is thrown when the JSON is not parseable.

I have a feeling it's something with the internet related winetricks because although foo_audioscrobbler & foo_uie_biography work fine & foo_softplaylists can love a track fine but will crash when it tries to get a list of top tracks for an artist or the like.
So it would seem that anything to do with large datasets causes problems.

I'll direct my attention here now and if it's just not happening then i'll update my foobar setup, your script and all and winebottler it once again.
So... you might hear from me again.
...
nah! i won't bug you no more


thanks for all your help, marc.

EDIT:
I tried to manually hit the ws.audioscrobbler.com/2.0/?format=json&api_key=&username=&s= link through the browser and i see:
Code: [Select]
{"error":3,"message":"Invalid Method - No method with that name in this package","links":[]}
any ideas?
ok, checked http://www.last.fm/api/show/user.getLovedTracks and it seems the script needs an update after all

WSH Panel Mod script discussion/help

Reply #3195
EDIT:
I tried to manually hit the ws.audioscrobbler.com/2.0/?format=json&api_key=&username=&s= link through the browser and i see:
Code: [Select]
{"error":3,"message":"Invalid Method - No method with that name in this package","links":[]}
any ideas?
ok, checked http://www.last.fm/api/show/user.getLovedTracks and it seems the script needs an update after all
um... sorry, scratch this part as everything i said is incorrect
:/

WSH Panel Mod script discussion/help

Reply #3196
^you only used a portion of the URL - that's why you didn't get any results. 

Quote
So it would seem that anything to do with large datasets causes problems.


no, it's nothing to do with that. foo_softplaylists crashes because the api_key has been revoked. if you search the relevant thread, you'll find romor has built a patched version which doesn't crash.

and i suspect the components that work do because they're built using c++ which use windows APIs which are better supported in WINE.

either install ie8 and deal with the consequences or forget it.


WSH Panel Mod script discussion/help

Reply #3197
^you only used a portion of the URL - that's why you didn't get any results. 
yes, i realized that

Quote
So it would seem that anything to do with large datasets causes problems.
no, it's nothing to do with that. foo_softplaylists crashes because the api_key has been revoked. if you search the relevant thread, you'll find romor has built a patched version which doesn't crash.
On it. Thanks


----
PS: I think I'll just upgrade my entire foobar setup with all the new jazz.

Thanks for your help.
Much appreciated

WSH Panel Mod script discussion/help

Reply #3198
install windows in bootcamp (or even a virtual machine). problem solved.

WSH Panel Mod script discussion/help

Reply #3199
install windows in bootcamp (or even a virtual machine). problem solved.
haha! bootcamp? that would be one big bloated waste of space.
Virtual machine? ...no less which is why I opted for Wine or CrossOver.

PS: romor's foo_softplaylists mod works (thanks for the tip).
So... It's just your script, marc2003, that's not working now

PPS: Just to have your script working again is why I'm even considering upgrading foobar ...and WineBottle it