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: JScript Panel (Read 306560 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: JScript Panel

Reply #625
The fix works, thanks very much!!



Re: JScript Panel

Reply #628
I know huge walls of text can be off putting but this is the first sentence.

Quote
The changelog for this release is bit of a monstrosity but if you use any of the included Samples, you really need to read that section. All of them will fail to load until you take the steps described below.

Specifically...

Quote
The internal file structure for all samples has changed meaning existing users will see blank panels or script errors on their first run. The scripts inside the panels must be updated from the Configuration Window Samples menu.




Re: JScript Panel

Reply #632
You never have to restart foobar when updating scripts. And the scratchbox thing is irrelevant.

If you upgraded from a previous version of the component, you had code saved in the panel that causes that exact error. Updating from the Samples menu like I clearly instructed overwrites the text in the panel and the problem is gone.

Now answer the question about the code on line 11.



Re: JScript Panel

Reply #635
Guys, hi, can you help me? I have a button with this function:

function(){fb.RunContextCommand('Tagging/Get tags from MusicBrainz (by artist & album)')});
however it doesn't work on selected items, only on now playing single item. How do I make it work with selection?

Re: JScript Panel

Reply #636
I know that. I did that.  I imported the sample thumbs. I say it the last time: You didn't shutdown foobar2000 and restart some time after installation and importing. The error message is cosmetic, the panel is working.

Image: panel working, but error message after restart

Re: JScript Panel

Reply #637
And you think constantly building/testing components doesn't require me to restart foobar2000... a lot. OK then. :/

I'll happily concede to there being bugs and fixing them if you can point them out.

This error....

JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003)
Laufzeitfehler in JavaScript:
"_" ist undefiniert
File: <main>
Line: 11, Col: 1

can not exist when there is no instance of any _ variable in the updated thumbs script (like there is in the old version).

Please don't tell me you have multiple instances and have only updated one or something like that? I vaguely recall a situation like that happening with you before....

For the record, initialising scripts from clicking OK/Apply is identical to how they are handled on startup. Deep down you know that, right?

Re: JScript Panel

Reply #638
Guys, hi, can you help me? I have a button with this function:

function(){fb.RunContextCommand('Tagging/Get tags from MusicBrainz (by artist & album)')});
however it doesn't work on selected items, only on now playing single item. How do I make it work with selection?

You'll need to use fb.RunContextCommandWithMetadb. You can pass it a handle list like this for selected playlist items

Code: [Select]
var items = plman.GetPlaylistSelectedItems(plman.ActivePlaylist);
fb.RunContextCommandWithMetadb('Tagging/Get tags from MusicBrainz (by artist & album)', items);


Re: JScript Panel

Reply #639
My console output:

Quote
[16:05:38] Components loaded in: 0:00.194916
[16:05:39] Configuration read in: 0:00.074945
[16:05:39] foobar2000 v1.6.7 [standard]
[16:05:40] Watching: G:\mp3
[16:05:40] JScript Panel v2.7.0-Beta.4 (codec icon v1 by grimes): initialised in 11 ms
[16:05:40] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003): initialised in 128 ms
[16:05:40] JScript Panel v2.7.0-Beta.4 (JS Smooth Browser v2021-mod by Br3tt aka Falstaff): initialised in 24 ms
[16:05:40] JScript Panel v2.7.0-Beta.4 (Spectrogram Seekbar by marc2003): initialised in 34 ms
[16:05:41] Filter Panel - Genre: initialised in 0.133 s
[16:05:41] Filter Panel - Composer: initialised in 0.063 s
[16:05:41] Filter Panel - Album: initialised in 0.106 s
[16:05:41] Album list panel: initialised in 0.161 s
[16:05:41] Album list panel: initialised in 0.195 s
[16:05:41] Album list panel: initialised in 0.194 s
[16:05:42] Album list panel: initialised in 0.542 s
[16:05:42] Album list panel: initialised in 0.203 s
[16:05:42] Album list panel: initialised in 0.201 s
[16:05:43] Album list panel: initialised in 0.221 s
[16:05:43] Album list panel: initialised in 0.207 s
[16:05:43] Album list panel: initialised in 0.236 s
[16:05:43] Album list panel: initialised in 0.211 s
[16:05:43] Album list panel: initialised in 0.214 s
[16:05:44] Album list panel: initialised in 0.233 s
[16:05:44] Album list panel: initialised in 0.364 s
[16:05:44] Album list panel: initialised in 0.242 s
[16:05:45] Album list panel: initialised in 0.575 s
[16:05:45] Album list panel: initialised in 0.519 s
[16:05:47] Album list panel: initialised in 1.194 s
[16:05:47] Album list panel: initialised in 0.291 s
[16:05:49] Album list panel: initialised in 1.619 s
[16:05:49] Album list panel: initialised in 0.289 s
[16:05:49] Playlist view initialised in: 0.009 s
[16:05:50] User Interface initialized in: 0:10.665007
[16:05:50] Graphic Equalizer: initialized (SSE support: 3)
[16:05:50] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003): file not found C:\Users\Lange\AppData\Roaming\foobar2000\user-components\foo_jscript_panel\samples\complete\js\lodash.min.js
[16:05:50] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003): file not found C:\Users\Lange\AppData\Roaming\foobar2000\user-components\foo_jscript_panel\samples\complete\js\helpers.js
[16:05:50] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003): file not found C:\Users\Lange\AppData\Roaming\foobar2000\user-components\foo_jscript_panel\samples\complete\js\panel.js
[16:05:50] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003): file not found C:\Users\Lange\AppData\Roaming\foobar2000\user-components\foo_jscript_panel\samples\complete\js\thumbs.js
[16:05:50] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003)
Laufzeitfehler in JavaScript:
"_" ist undefiniert
File: <main>
Line: 11, Col: 1
[16:05:51] FFmpeg version: 4.3.1
[16:05:54] Autoplaylists initialized in: 0:03.146417
[16:05:54] "5 Star" : 0:00.292334
[16:05:54] "Alexander Scriabin" : 0:00.062100
[16:05:54] "Alfred Schnittke" : 0:00.029562
[16:05:54] "All Music" : 0:00.025769
[16:05:54] "Allan Pettersson" : 0:00.036881
[16:05:54] "Anton Bruckner" : 0:00.048938
[16:05:54] "Antonin Dvorak" : 0:00.038408
[16:05:54] "Arnold Bax" : 0:00.038855
[16:05:54] "Arnold Schönberg" : 0:00.026662
[16:05:54] "BPM" : 0:00.195803
[16:05:54] "Bela Bartok" : 0:00.035823
[16:05:54] "Benjamin Britten" : 0:00.036386
[16:05:54] "Bohuslav Martinu" : 0:00.025367
[16:05:54] "Bootleg" : 0:00.028182
[16:05:54] "Carl Nielsen" : 0:00.031966
[16:05:54] "Charles Ives" : 0:00.023215
[16:05:54] "Classical" : 0:00.029137
[16:05:54] "Darius Milhaud" : 0:00.024464
[16:05:54] "Dmitri Shostakovich" : 0:00.048681
[16:05:54] "Eduard Tubin" : 0:00.023795
[16:05:54] "Egon Wellesz" : 0:00.045751
[16:05:54] "Einar Englund" : 0:00.027141
[16:05:54] "Einojuhani Rautavaara" : 0:00.025916
[16:05:54] "Ernst Krenek" : 0:00.025240
[16:05:54] "Ernst Toch" : 0:00.025351
[16:05:54] "Franz Schubert" : 0:00.026419
[16:05:54] "Frederic Chopin" : 0:00.031608
[16:05:54] "Gian Francesco Malipiero" : 0:00.024384
[16:05:54] "Gustav Holst" : 0:00.026724
[16:05:54] "Gustav Mahler" : 0:00.037495
[16:05:54] "Heitor Villa-Lobos" : 0:00.024274
[16:05:54] "Hilary Hahn" : 0:00.021155
[16:05:54] "Hugo Alfven" : 0:00.024184
[16:05:54] "Humphrey Searle" : 0:00.023324
[16:05:54] "Igor Stravinsky" : 0:00.035856
[16:05:54] "Isang Yun" : 0:00.022914
[16:05:54] "Jean Sibelius" : 0:00.024914
[16:05:54] "Jimi Hendrix" : 0:00.042790
[16:05:54] "Johann Sebastian Bach" : 0:00.036209
[16:05:54] "Johannes Brahms" : 0:00.017814
[16:05:54] "Josef Tal" : 0:00.023019
[16:05:54] "Jörg Widmann" : 0:00.024540
[16:05:54] "Kalevi Aho" : 0:00.016929
[16:05:54] "Karol Szymanowski" : 0:00.023430
[16:05:54] "King Crimson" : 0:00.027796
[16:05:54] "Last Added" : 0:00.148158
[16:05:54] "Last Played" : 0:00.183984
[16:05:54] "Led Zeppelin" : 0:00.046673
[16:05:54] "Lennox Berkeley" : 0:00.038608
[16:05:54] "Leonard Bernstein" : 0:00.027017
[16:05:54] "Ludwig van Beethoven" : 0:00.030849
[16:05:54] "Malcolm Arnold" : 0:00.023514
[16:05:54] "Martha Argerich" : 0:00.021664
[16:05:54] "Matthijs Vermeulen" : 0:00.026299
[16:05:54] "Michael Tippett" : 0:00.025322
[16:05:54] "Mieczyslaw Weinberg" : 0:00.023891
[16:05:54] "Mikis Theodorakis" : 0:00.024023
[16:05:54] "Morton Feldman" : 0:00.024136
[16:05:54] "Muse" : 0:00.021489
[16:05:54] "Neil Young" : 0:00.032149
[16:05:54] "Non Classical" : 0:00.049682
[16:05:54] "Official" : 0:00.035877
[16:05:54] "Olivier Messiaen" : 0:00.026092
[16:05:54] "Pink Floyd" : 0:00.069966
[16:05:54] "Playcount sorted" : 0:00.111139
[16:05:54] "Pyotr Ilyich Tchaikovsky" : 0:00.025005
[16:05:54] "Ralph Vaughan Williams" : 0:00.024367
[16:05:54] "Robert Simpson" : 0:00.024321
[16:05:54] "Rued Langgaard" : 0:00.026083
[16:05:54] "Sergei Prokofiev" : 0:00.036070
[16:05:54] "Supertramp" : 0:00.022208
[16:05:54] "Tangerine Dream" : 0:00.021924
[16:05:54] "Truls Mork" : 0:00.020350
[16:05:54] "Vanilla Fudge" : 0:00.022257
[16:05:54] "William Alwyn" : 0:00.023567
[16:05:54] "William Schuman" : 0:00.023786
[16:05:54] "Witold Lutoslawski" : 0:00.022491
[16:05:54] "Wolfgang Amadeus Mozart" : 0:00.023361
[16:05:54] "Yehudi Menuhin" : 0:00.021235
[16:05:54] "Yes" : 0:00.030822
[16:05:54] Startup time : 0:15.446396

Re: JScript Panel

Reply #640
The error message is cosmetic, the panel is working.

I missed this edit. No, that's impossible. That popup dialog would never present itself without the panel turning red/showing javascript error as my gif illustrates. Clearly you have multiple instances just as I guessed in my previous post.


Re: JScript Panel

Reply #642
Correct, the internal folder structure has been updated as per my very first post.

Quote
    The internal file structure for all samples has changed meaning existing users will see blank panels or script errors on their first run. The scripts inside the panels must be updated from the Configuration Window Samples menu.

You've successfully updated one instance of a previous thumbs panel as can be seen from your console output.

Code: [Select]
[16:05:40] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003): initialised in 128 ms

You have another instance which you have not updated.
Code: [Select]
[16:05:50] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003): file not found C:\Users\Lange\AppData\Roaming\foobar2000\user-components\foo_jscript_panel\samples\complete\js\lodash.min.js
[16:05:50] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003): file not found C:\Users\Lange\AppData\Roaming\foobar2000\user-components\foo_jscript_panel\samples\complete\js\helpers.js
[16:05:50] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003): file not found C:\Users\Lange\AppData\Roaming\foobar2000\user-components\foo_jscript_panel\samples\complete\js\panel.js
[16:05:50] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003): file not found C:\Users\Lange\AppData\Roaming\foobar2000\user-components\foo_jscript_panel\samples\complete\js\thumbs.js
[16:05:50] JScript Panel v2.7.0-Beta.4 (Thumbs by marc2003)
Laufzeitfehler in JavaScript:
"_" ist undefiniert
File: <main>
Line: 11, Col: 1


Re: JScript Panel

Reply #643
Can't find multiple instances of thumbs.

You have 2 artist images tabs in your previous screenshot. Could be a red herring but I don't see how you can expect anyone who isn't you to find it.

Re: JScript Panel

Reply #644
Guys, hi, can you help me? I have a button with this function:

function(){fb.RunContextCommand('Tagging/Get tags from MusicBrainz (by artist & album)')});
however it doesn't work on selected items, only on now playing single item. How do I make it work with selection?

You'll need to use fb.RunContextCommandWithMetadb. You can pass it a handle list like this for selected playlist items

Code: [Select]
var items = plman.GetPlaylistSelectedItems(plman.ActivePlaylist);
fb.RunContextCommandWithMetadb('Tagging/Get tags from MusicBrainz (by artist & album)', items);
Thank you! But for me items variable only updates when I save the Jscript code, so properties window opens for items that were selected when I saved the script. Can you help me make it update "in real time"?
My button code is
Code: [Select]
if (bbtn3_b) Buttons.bottom3 = new Button(ww / 2 - 87, 90, 58, 14, b, function(){fb.RunContextCommandWithMetadb('Tagging/Get tags from MusicBrainz (by artist & album)', items);});

Re: JScript Panel

Reply #645
The var items... bit needs to go inside the function block

Code: [Select]
if (bbtn3_b)
    Buttons.bottom3 = new Button(ww / 2 - 87, 90, 58, 14, b, function () {
        var items = plman.GetPlaylistSelectedItems(plman.ActivePlaylist);
        fb.RunContextCommandWithMetadb('Tagging/Get tags from MusicBrainz (by artist & album)', items);
    });

Re: JScript Panel

Reply #646
The var items... bit needs to go inside the function block

Code: [Select]
if (bbtn3_b)
    Buttons.bottom3 = new Button(ww / 2 - 87, 90, 58, 14, b, function () {
        var items = plman.GetPlaylistSelectedItems(plman.ActivePlaylist);
        fb.RunContextCommandWithMetadb('Tagging/Get tags from MusicBrainz (by artist & album)', items);
    });
Perfect, thank you very much!


Re: JScript Panel

Reply #648
2.7.0 final has been released. Just a few minor sample fixes since the last beta.

https://github.com/marc2k3/foo_jscript_panel/releases

For anyone upgrading from 2.6.x or earlier, there are breaking changes and sample changes aplenty. Please check the big ol' wall of text or don't install it.

Old versions are available here: https://github.com/marc2k3/foo_jscript_panel/wiki/Old-Versions

Re: JScript Panel

Reply #649
Binary is missing.