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 script discussion/help (Read 121029 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: JScript Panel script discussion/help

Reply #825
I've never had anything to do with that particular script. Obviously the first thing you need to do is make all the changes necessary for it to work in SMP. If it works in JSP v2.4.0 right now, there is absolutely no way it's going to work without some tweaks. @TheQwertiest has detailed documentation on the changes required...

https://theqwertiest.github.io/foo_spider_monkey_panel/docs/guides/jsp_to_smp_migration_guide/

Re: JScript Panel script discussion/help

Reply #826
Hi, this is not working:
Code: [Select]
var objShell = new ActiveXObject('Shell.Application');
objShell.NameSpace(panel.tf('$directory_path(%path%)')).ParseName(panel.tf('%filename_ext%')).ModifyDate = '2018/09/07 15:51';
both panel.tf('$directory_path(%path%)') and panel.tf('%filename_ext%') return a correct value for the file to be changed, but date does not get modified.
If I run the same code, replacing 'panel.tf' values, from WSH, it does work. Any clue? Thanks.

Re: JScript Panel script discussion/help

Reply #827
Seems to work fine for me?? Bear in mind that if you have a last modified column in your playlist, it won't update automatically since you're updating the file externally. Running this directly after may help...

Code: [Select]
fb.RunContextCommandWithMetadb("Tagging/Reload info from file(s) if changed", panel.metadb);

Re: JScript Panel script discussion/help

Reply #828
Seems to work fine for me??
Actually it works. The reason my code is not working is because there are three lines just before,
Code: [Select]
var handles = fb.CreateHandleList(panel.metadb);
handles.UpdateFileInfoFromJSON(JSON.stringify(obj));
_.dispose(handles);
And it takes some time to update the file, i guess asynchronously, so when my code is run the file is not available. Is there any way to make sure UpdateFileInfoFromJSON has done its job before I update file modified time?

Quote
Bear in mind that if you have a last modified column in your playlist, it won't update automatically since you're updating the file externally. Running this directly after may help...
Code: [Select]
fb.RunContextCommandWithMetadb("Tagging/Reload info from file(s) if changed", panel.metadb);
Thanks for that tip!

Re: JScript Panel script discussion/help

Reply #829
Yes it's async but I would expect a single track to get updated pretty much instantly?? You get a progress dialog for longer operations and the component has no way of knowing when it's complete.

Anyway, check File>Preferences>Advanced>Tagging>General>Preserve file creation/access/modification time. That probably bypasses the need to write old timestamps back??

Re: JScript Panel script discussion/help

Reply #830
Yes it's async but I would expect a single track to get updated pretty much instantly??
Not really, otherwise my code would have worked. I solved it with a window.setTimeout call.

Quote
Anyway, check File>Preferences>Advanced>Tagging>General>Preserve file creation/access/modification time. That probably bypasses the need to write old timestamps back??
That could help. Thanks!.

Re: JScript Panel script discussion/help

Reply #831
In the sample script "Thumbs", I can search with %artist% in the last fm artist database. I have a lot of classical music and I'm interested in composer pictures. The composers name is stored in my %performer% tag. How can I search in the last fm database with %performer%?

Re: JScript Panel script discussion/help

Reply #832
Open the configuration window and enter this as the first line of the script before var panel...

Code: [Select]
DEFAULT_ARTIST = '$meta(performer,0)';

You could use %performer% if you were sure all tags are single value. Lookups of multi-value tags would not work well.

Re: JScript Panel script discussion/help

Reply #833
Thank you, it works!

Re: JScript Panel script discussion/help

Reply #834
Hello all, i use JS Smooth Browser to see my new album in my librairie, i would like to have the most recent at the beginning so i add this in the Panel properties "sort order album :  $date(%last_modified%) | %album% | %discnumber% | %tracknumber% | %title% ".
l works fine but my newest albums are at the end of the list ...is it possible to sort the list by descending ?
i try : SORT BY DESCENDING  $date(%last_modified%) but nothing changed.....
thanks for your help.


Re: JScript Panel script discussion/help

Reply #836
 ;)  ;)  ;)
Fine, thank you !

Re: JScript Panel script discussion/help

Reply #837
Feature request for sample script "playback buttons": add option to center buttons in panel. Thanks.

Re: JScript Panel script discussion/help

Reply #838
Replace existing buttons.update function with this...

Code: [Select]
buttons.update = function () {
var x_pos = (panel.w - (bs * 4)) / 2;
this.buttons.stop = new _.button(x_pos, 0, bs, bs, {normal : 'buttons\\stop.png'}, function (x, y, mask) { fb.Stop(); }, 'Stop');
this.buttons.play = new _.button(x_pos + bs, 0, bs, bs, {normal : !fb.IsPlaying || fb.IsPaused ? 'buttons\\play.png' : 'buttons\\pause.png'}, function (x, y, mask) { fb.PlayOrPause(); }, !fb.IsPlaying || fb.IsPaused ? 'Play' : 'Pause');
this.buttons.previous = new _.button(x_pos + (bs * 2), 0, bs, bs, {normal : 'buttons\\previous.png'}, function (x, y, mask) { fb.Prev(); }, 'Previous');
this.buttons.next = new _.button(x_pos + (bs * 3), 0, bs, bs, {normal : 'buttons\\next.png'}, function (x, y, mask) { fb.Next(); }, 'Next');
}

 
SimplePortal 1.0.0 RC1 © 2008-2021