Skip to main content
Topic: JScript Panel (Read 81067 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: JScript Panel

Reply #300
Code: [Select]
v1.3.0-Beta-1
- CHG: Support for IE7/IE8/WINE users has been dropped. Your computer
       must have IE9 or later installed.
- CHG: The "UpdateFileInfoSimple" handle and handle list methods are
       now gone.
- ADD: A new "UpdateFileInfoFromJSON" method has been added. See
       https://github.com/19379/foo-jscript-panel/wiki/Breaking-Changes#v130
       If anyone needs help with this, just ask.
- ADD: You can now create an empty handle list with fb.CreateHandleList()
       See docs\interfaces.txt

https://github.com/19379/foo-jscript-panel/releases

Users of @WilB 's bio script who use it to update tags should avoid for now. Also, anyone else who uses the component to update tags should read this link to find out what is broken and how to update.

https://github.com/19379/foo-jscript-panel/wiki/Breaking-Changes#v130 << this has had notable changes since I posted the first draft the other day

If anyone has trouble understanding it, then ask for help.

This update will only be available on github. I'm not posting it on the official components site because I don't want people blindly updating to it!

edit: renamed Alpha to Beta,  :P

Re: JScript Panel

Reply #301
Beta version is now final. Details in previous post.

Because of the breaking changes, v1.2.4 will remain available on the official components site and on the github releases page.

Re: JScript Panel

Reply #302
Hi, from today I have this error :
Quote
JScript Panel (Menu Button by marc2003)
Erreur d’exécution JavaScript:
Un composant ActiveX ne peut pas créer un objet
File: E:\Ma LiberKey 5\MyApps\foobar2000\js_marc2003\js\helpers.js
Line: 45, Col: 1
<source text only available at compile time>
I have update with last version but same error
Quote
JScript Panel (Menu Button by marc2003)
Erreur d’exécution JavaScript:
Un composant ActiveX ne peut pas créer un objet
File: E:\Ma LiberKey 5\MyApps\foobar2000\user-components\foo_jscript_panel\samples\complete\js\helpers.js
Line: 560, Col: 1
<source text only available at compile time>

Re: JScript Panel

Reply #303
You generally don't see ActiveX errors with this component and any version of Windows unless something is really broken or perhaps something is interfering like an over-zealous security application??? Can you think anything just installed/changed recently?

What is the output of this script alone in a panel??

Code: [Select]
var arr = ['htmlfile', 'Shell.Application', 'WScript.Shell', 'Scripting.FileSystemObject', 'ScriptControl'];

for (var i = 0; i < arr.length; i++) {
try {
var obj = new ActiveXObject(arr[i]);
if (arr[i] == 'ScriptControl')
obj.Language = 'VBScript';
fb.Trace(arr[i] + ' tested OK!');
} catch (e) {
fb.Trace(arr[i] + ' not OK!')
}
}

Check the Console. I get...

Code: [Select]
htmlfile tested OK!
Shell.Application tested OK!
WScript.Shell tested OK!
Scripting.FileSystemObject tested OK!
ScriptControl tested OK!

Re: JScript Panel

Reply #304
Quote
htmlfile tested OK!
Shell.Application tested OK!
WScript.Shell tested OK!
Scripting.FileSystemObject tested OK!
ScriptControl not OK!
JScript Panel ({9D1E0696-2F50-42AE-95E5-8B494D9D0A40}): initialised in 10 ms

I do not install anything more than the update nvidia drivers, nodejs, git !
before sending the message I desintaler last update windows update (KB)

Re: JScript Panel

Reply #305
Well sorry but I have no idea how to fix that. Something has been corrupted or is being blocked??

But you can use most of my scripts without it You can browse to samples\complete\js\helpers.js and comment out these lines... (around 560 according to your previous post)

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

This will break anything that requires a popup dialog for user input so my autoplaylists script would be unusable.

edit: maybe you could try running this from an administator command prompt (assuming 64bit windows??)

Code: [Select]
c:\windows\syswow64\regsvr32 c:\windows\syswow64\msscript.ocx

Re: JScript Panel

Reply #306
works by deleting both lines! Thank you
I have tried with a new foobar2000 installation and even error.

Note I use Windows 10 x64, it had always worked until today. Maybe because of an IE update. I had IE11 installed but I removed it to try to correct the error.

ps: I would like to suggest a new design for "CD Javel Case Modern". (I use it)

edit : Can't load module
I have no file msscript.ocx in syswow64


Re: JScript Panel

Reply #308
@marc2003
Now that you're using Windows 10, might you consider looking into updating to ECMAScript 6?


Re: JScript Panel

Reply #310
You've already posted in a previous discussion about how it isn't possible...  ;D
I couldn't have posted about how it's not possible because that's over my head. I did read the posts--then forgot all the technical explanations, retaining only that you and TheQuertiest were using Windows 8.1 and 7, respectively, and somehow concluding that it might be possible when you could test it. Sometimes, it's hell getting old.

Quote
I guess you could code in ES6 and transpile it with something like babel?
Or, to paraphrase myself, I can code JScript Panel in ES5 and like it. :)

Re: JScript Panel

Reply #311
Even though it might break for a handful of users, I've decided to go ahead and stick the latest version on the official components site.

If people really are stuck on Vista/7 which they cannot upgrade to IE9 or are using WINE, they can safely downgrade to v1.2.4 which is still available on github.

Re: JScript Panel

Reply #312
@marc2003

Hi Marc,

I'm playing around with your 'rating' script in conjunction with js-smooth browser but have a minor issue.

When I rate a song, then rate the next track, it overwrites the first rating.
I can change it successfully by selecting, deselecting and selecting again the second track I want to rate.

But I'm wondering if there's a more elegant way to refresh the rating when changing track?

Don't worry if it's too much, and thank you for your work all the same!

Re: JScript Panel

Reply #313
Sorry, I have no idea what you're talking about.

All I can say is check the right click selection mode setting on the rating script. The first option means it will always be focused on the playing item even if something else is selected. Option 2 will always focus on the selected track and the tooltips you get when hovering it always show the artist/title so you should always know before clicking it.


Re: JScript Panel

Reply #315
Wingdings 3, characters u and w

Re: JScript Panel

Reply #316
Yeah, I came back to share the fonts after finding out it was those, anyway you can download them on megafonts.net (don't know if I am allowed to link them)

It seems to be for everything though @marc2003 (play/check), anyways thanks really appreciate it.

Re: JScript Panel

Reply #317
Hi,

I was wondering if there was a way to access the panel outside of the foobar application because
I was trying to see if I could things such as "fb.Play()" outisde of the application and I couldn't find
a way.

Thank you
 



Re: JScript Panel

Reply #320
How would you refer to the box created if I
want to add an event listener e.g. (what could I put in place of "element"?)

Code: [Select]
element.addEventListener('keydown', function(ev){
console.log(ev.which);
});

var e = new KeyboardEvent('keydown',{'keyCode':75,'which':75});
console.log(e);
element.dispatchEvent(e);
break;

Thanks

Re: JScript Panel

Reply #321
fb.Trace is the component's equivalent to console.log. If you want to use console.log in your script, you can write your own function like this...

Code: [Select]
var console = {
    log: function (message) {
        fb.Trace(message);
    }
}

And you can't use html/DOM stuff like addEventListener. You'll need to use the on_key_up and on_key_down callbacks from docs\callbacks.txt

Code: [Select]
var console = {
log: function (message) {
fb.Trace(message);
}
}

function on_key_down(vkey) {
if (vkey == 75) {
console.log("You pressed k");
}
}

https://github.com/19379/foo-jscript-panel/blob/d9db86494ec68d48c6812c458a29fa20dea1c4f1/foo_jscript_panel/docs/Callbacks.txt#L40L50


Re: JScript Panel

Reply #322
Hi Marc
I've modified my existing script, that tidies new tracks, to use your new tag update method - all working fine. However one function in my script removes unwanted tags. Currently I have a fixed list of required tag names and loop through all files and all tags, either removing or skipping them according to this list. It occurs to me that there must be a better way to do this, any ideas?

Cheers and once again thanks for your work so far.

Re: JScript Panel

Reply #323
Are you using the GetFileInfo handle method to get all tags from each file? If so, I don't think there is anything else you can do to improve it. I assume you can't know the bad tags in advance if the files are from random sources so your only choice is to loop through them.

Re: JScript Panel

Reply #324
Hi Marc
Thanks for the quick reply. Yes I'm using GetFileInfo as you thought.

One idea could be for you to modify UpdateFileInfoFromJSON to allow it to either add/overrite existing tags as now with a switch to remove all tags not in the array.

Just a thought!

 
SimplePortal 1.0.0 RC1 © 2008-2019