IPB

Welcome Guest ( Log In | Register )

125 Pages V  « < 71 72 73 74 75 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help.
romor
post Aug 27 2012, 16:50
Post #1801





Group: Members
Posts: 670
Joined: 16-January 09
Member No.: 65630



QUOTE (marc2003 @ Aug 25 2012, 15:56) *
edit it so it becomes...

CODE
WshShell.Run("cscript //nologo " + script_path...

marc2003, can't you use WSC (wrap vbscript in XML and set parameters) then call it as object function from javascript?

I've done the opposite here, when needed crypto service from javascript function, not knowing that there is already crypto COM object exposed by .NET

Hope it helps instead complicate things wink.gif

This post has been edited by romor: Aug 27 2012, 16:51


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
marc2003
post Aug 28 2012, 13:51
Post #1802





Group: Members
Posts: 4446
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (mjm716 @ Aug 25 2012, 22:05) *
I tested that filename path was correct and file exists = true; but if read is a function, it's missing?


the read function is my common4.js file. it would error if missing plus no text from any cached files would display. although unlikely, it's possible the txt file is empty but it shouldn't be created unless there was something to save.

QUOTE
the WSH version only displays & saves to allmusic_bio.txt the 1st paragraph from allmusic, while the biography panel displays the whole bio text...


i have no idea why this is. i'll look into it. this is now fixed. just the script in the panel needs re-importing.

@romor, i'm not using your amazon script so i don't really have any idea what you're on about. tongue.gif if you look at the parameters, i'm just calling your allmusic script with a file path added to the end. rather than output the text using WScript.echo, i'm saving to text file which my script then reads.

i know it should be fairly trivial to port the whole thing into a WSH panel but i've don't have much access to a computer at the moment.

This post has been edited by marc2003: Aug 28 2012, 14:24
Go to the top of the page
+Quote Post
romor
post Aug 28 2012, 15:26
Post #1803





Group: Members
Posts: 670
Joined: 16-January 09
Member No.: 65630



QUOTE (marc2003 @ Aug 28 2012, 14:51) *
i'm not using your amazon script so i don't really have any idea what you're on about. tongue.gif if you look at the parameters, i'm just calling your allmusic script with a file path added to the end. rather than output the text using WScript.echo, i'm saving to text file which my script then reads.

I was suggesting you use it as COM object instead using shell run. You could run any function from it as it was JS. Amazon script was working example
Nevermind...

Cheers


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
Emerelle
post Sep 1 2012, 00:04
Post #1804





Group: Members
Posts: 142
Joined: 3-November 11
Member No.: 94918



Concerning my problems with the allmusic script, I think I found out that I simply dont receive any info because that very album is not there, in spite of the artist info being there. I think that is the way it works? Its a pity though wink.gif

I have another two questions for the simple text reader: Does the path to the text file need to be changed in both script and dialog? I tried to insert an if function because I wanted it to look in one level up if no info.txt is found, but that did not display anything.
Second question concerns the right margin: I managed to change both top and left text margins only the value for the right one is unclear to me which one I have to change in the script.
Go to the top of the page
+Quote Post
marc2003
post Sep 1 2012, 12:01
Post #1805





Group: Members
Posts: 4446
Joined: 27-January 05
From: England
Member No.: 19379



normally users would not need to edit the script as the dialog accepts any title formatting. your problem is that you cannot check for the existence of files using title formatting alone. i might add a hack to get around this.

as for the margins, you need to browse the marc2003 folder in your foobar profile directory. edit common4.js in a text editor. on line 286, you'll see

CODE
        lines = temp_gr.EstimateLineWrap(paragraphs[i], normal_font, ww - 16).toArray();


ww - 16 is the relevant bit. increase the number to make the margin bigger. after changes have been saved you need to reload the script in your panel for it to pick the changes up.

also i should mention that playing with the top margin may break the calculation for how many rows to display. you might need to adjust the panel script on line 25.

CODE
rows = Math.floor((wh - 32) / row_height);


just the number 32 would need tweaking.

This post has been edited by marc2003: Sep 1 2012, 12:20
Go to the top of the page
+Quote Post
marc2003
post Sep 1 2012, 13:19
Post #1806





Group: Members
Posts: 4446
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (marc2003 @ Sep 1 2012, 12:01) *
normally users would not need to edit the script as the dialog accepts any title formatting. your problem is that you cannot check for the existence of files using title formatting alone. i might add a hack to get around this.


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

simple text reader you can now use multiple file paths in the path to text file dialog. it will check each one in turn until a file is found. separate each entry using | with no spaces.

unfortunately there is a limit of 255 characters for the standard input dialog. if you find yourself running into this limit, hold down shift before right clicking the panel. select Properties from the menu and then edit the value of text_file in the popup dialog.
Go to the top of the page
+Quote Post
Emerelle
post Sep 1 2012, 20:45
Post #1807





Group: Members
Posts: 142
Joined: 3-November 11
Member No.: 94918



Awesome Marc, thanks so much for both your advice and the update.

EDIT - I figured it out - look in one folder up works like this
$directory_path($directory_path(%path%))\info.txt

And now it works for both the content folder plus one folder up using it like this:

$directory_path(%path%)\info.txt|$directory_path($directory_path(%path%))\info.txt

Awesome! smile.gif

This post has been edited by Emerelle: Sep 1 2012, 21:31
Go to the top of the page
+Quote Post
Sixth Street
post Sep 7 2012, 20:25
Post #1808





Group: Members
Posts: 81
Joined: 17-September 09
Member No.: 73255



Has anyone tried Marc2003's scripts in OSX via wineskin? I have my config working very well, but use Marc2003's scripts heavily, and am getting errors all over the place. I have one other WSH panel working fine that doesn't any dependencies so I don't think it's a WSH panel problem.
Go to the top of the page
+Quote Post
rawny
post Sep 8 2012, 01:05
Post #1809





Group: Members
Posts: 30
Joined: 27-January 09
Member No.: 66042



QUOTE (Sixth Street @ Sep 7 2012, 20:25) *
Has anyone tried Marc2003's scripts in OSX via wineskin? I have my config working very well, but use Marc2003's scripts heavily, and am getting errors all over the place. I have one other WSH panel working fine that doesn't any dependencies so I don't think it's a WSH panel problem.

I run them under Wine on Ubuntu and had errors at first. I basically had to comment out some parts of the common4.js script. I think I figured out which ones by looking at the line number that was causing problems in the foobar console and going from there. I can specify which bits I effectively cut out if you like, although it may be a bit different for you. Also, naturally some of the scripts won't necessarily be usable if you do cut chunks out of the common script. Personally I'd rather have some than none so that's why I went down this route smile.gif

This post has been edited by rawny: Sep 8 2012, 01:06
Go to the top of the page
+Quote Post
Sixth Street
post Sep 8 2012, 02:59
Post #1810





Group: Members
Posts: 81
Joined: 17-September 09
Member No.: 73255



QUOTE (rawny @ Sep 7 2012, 19:05) *
I run them under Wine on Ubuntu and had errors at first. I basically had to comment out some parts of the common4.js script. I think I figured out which ones by looking at the line number that was causing problems in the foobar console and going from there. I can specify which bits I effectively cut out if you like, although it may be a bit different for you. Also, naturally some of the scripts won't necessarily be usable if you do cut chunks out of the common script. Personally I'd rather have some than none so that's why I went down this route smile.gif


I was going to attempt that but the console wasn't helpful. It reads:

WSH Panel Mod (Thumbs by marc2003): Parsing file "C:\users\Sixth Street\Application Data\foobar2000\marc2003\common3.js"

The popup dialog box says:

Scripting Engine Initialization Failed (Thumbs by marc2003, CODE: 0x800a01ad): Unknown error code (2148139437)

Any help would be greatly appreciated!
Go to the top of the page
+Quote Post
rawny
post Sep 8 2012, 03:37
Post #1811





Group: Members
Posts: 30
Joined: 27-January 09
Member No.: 66042



QUOTE (Sixth Street @ Sep 8 2012, 02:59) *
QUOTE (rawny @ Sep 7 2012, 19:05) *
I run them under Wine on Ubuntu and had errors at first. I basically had to comment out some parts of the common4.js script. I think I figured out which ones by looking at the line number that was causing problems in the foobar console and going from there. I can specify which bits I effectively cut out if you like, although it may be a bit different for you. Also, naturally some of the scripts won't necessarily be usable if you do cut chunks out of the common script. Personally I'd rather have some than none so that's why I went down this route smile.gif


I was going to attempt that but the console wasn't helpful. It reads:

WSH Panel Mod (Thumbs by marc2003): Parsing file "C:\users\Sixth Street\Application Data\foobar2000\marc2003\common3.js"

The popup dialog box says:

Scripting Engine Initialization Failed (Thumbs by marc2003, CODE: 0x800a01ad): Unknown error code (2148139437)

Any help would be greatly appreciated!

If you copy the whole of the common.js script into a panel above the script you're trying to use it for, or maybe even on its own to begin with, you should get more informative errors in the console. If your adding to a script though, make sure to remove the import line:
CODE
// @import "[...]common4.js"


This post has been edited by rawny: Sep 8 2012, 03:38
Go to the top of the page
+Quote Post
marc2003
post Sep 8 2012, 13:45
Post #1812





Group: Members
Posts: 4446
Joined: 27-January 05
From: England
Member No.: 19379



i've had my scripts working in WINE. i found an old post where i detailed what i had to do...

save this somewhere as winetricks

http://www.kegel.com/wine/winetricks

run it from a terminal

CODE
sh winetricks


select

CODE
gdiplus
ie8
wsh57


i suggest downloading my latest scripts (i can tell yours is old because you mention common3.js and i've been on common4.js for ages now).

edit common4.js in a text editor and comment out lines 401 & 402 like this...

CODE
//var vb = new ActiveXObject("ScriptControl");
//vb.Language = "VBScript";


doing this means input dialogs won't work from the context menu but if you copy the entire config from a working windows machine, it should just work. if you do need to set some variables then you might need to edit the script directly. give me a shout if you need any help.



Go to the top of the page
+Quote Post
rawny
post Sep 8 2012, 14:27
Post #1813





Group: Members
Posts: 30
Joined: 27-January 09
Member No.: 66042



QUOTE (marc2003 @ Sep 8 2012, 13:45) *
i've had my scripts working in WINE. i found an old post where i detailed what i had to do...

save this somewhere as winetricks

http://www.kegel.com/wine/winetricks

run it from a terminal
CODE
sh winetricks
select
CODE
gdiplus
ie8
wsh57

I'm not sure whether this part will be applicable as Sixth Street is running foobar on OSX via wineskin - they may have a winetricks equivalent though...? (I don't know how much wineskin differs from pure WINE.)

This post has been edited by rawny: Sep 8 2012, 14:38
Go to the top of the page
+Quote Post
marc2003
post Sep 8 2012, 14:32
Post #1814





Group: Members
Posts: 4446
Joined: 27-January 05
From: England
Member No.: 19379



oops, i missed that. rolleyes.gif i'd hazard a guess at WINE being installed though so it may work?? tongue.gif
Go to the top of the page
+Quote Post
rawny
post Sep 8 2012, 14:42
Post #1815





Group: Members
Posts: 30
Joined: 27-January 09
Member No.: 66042



Wow epic formatting screw-up -.-

I was trying to say that it might work from the point of view that some WINE is probably in there.

I think the best thing to do would be for Sixth to update all your scripts first and then see what's happening after that.

This post has been edited by rawny: Sep 8 2012, 14:46
Go to the top of the page
+Quote Post
romka18
post Sep 8 2012, 17:43
Post #1816





Group: Members
Posts: 47
Joined: 30-September 11
Member No.: 94073



writing playlist viewer like esplaylist - with grouping. i create an object - album, which contents the songs.

CODE
pl_album=function(name,content,metadb) {
                ...
                this.display_image=utils.GetAlbumArtV2(this.metadb,0,true);
            }

content=massive of objects contents the tracks
metadb=this.Items.item(i) - one item of playlist.

as i understand while creating groups i call for a cover, but callback on_album_image_load_done isnt called. what i doing wrong? or how better load images for albums on screen?
Go to the top of the page
+Quote Post
marc2003
post Sep 10 2012, 11:46
Post #1817





Group: Members
Posts: 4446
Joined: 27-January 05
From: England
Member No.: 19379



i don't think there is any such thing as on_album_image_load_done. there is on_get_album_art_done which is only called when using utils.GetAlbumArtAsync, not utils.GetAlbumArtV2.
Go to the top of the page
+Quote Post
Sixth Street
post Sep 10 2012, 15:41
Post #1818





Group: Members
Posts: 81
Joined: 17-September 09
Member No.: 73255



QUOTE (rawny @ Sep 8 2012, 08:42) *
I think the best thing to do would be for Sixth to update all your scripts first and then see what's happening after that.


Yup, you are correct. I should try the newest scripts first. It's just that I've heavily modified some of the scripts for my own usage and since they were working just fine never decided to update and have to try to re-create my modifications. I'll try the latest stock scripts and report back.
Go to the top of the page
+Quote Post
rawny
post Sep 10 2012, 21:03
Post #1819





Group: Members
Posts: 30
Joined: 27-January 09
Member No.: 66042



QUOTE (Sixth Street @ Sep 10 2012, 15:41) *
QUOTE (rawny @ Sep 8 2012, 08:42) *
I think the best thing to do would be for Sixth to update all your scripts first and then see what's happening after that.

Yup, you are correct. I should try the newest scripts first. It's just that I've heavily modified some of the scripts for my own usage and since they were working just fine never decided to update and have to try to re-create my modifications. I'll try the latest stock scripts and report back.

You could compare your modified versions and the new ones using some kind of text comparison program and then put your changes in, but yeah. Yell if you need any more help smile.gif

This post has been edited by rawny: Sep 10 2012, 21:03
Go to the top of the page
+Quote Post
godrick
post Sep 13 2012, 02:21
Post #1820





Group: Members
Posts: 305
Joined: 31-December 10
Member No.: 86948



I'm beating my head against a wall with something that seems simple, but I'm missing something - help appreciated!

I'm trying to invoke title formatting within a jscript to extract a portion of a path. For example, let e_1 equal the variable that contains the path. I echo e_1 to the console to ensure that e_1 really contains a path. For example, the console echoes

c:\users\xyz\appdata\roaming\123456789_kjl.jpg

as I expect, which means the script recognizes e_1 and knows that it contains the string it echoed to the console.

But in the very next line of the script, when I try

y4 = fb.TitleFormat("$strrchr(e_1),_)").Eval(); (in this case I'm looking for the first occurrence of an underscore in the path stored in e_1),

y4 equals 2 instead of 10 per the console echo. The title formatting is treating "e_1" as the string it's evaluating, instead of treating e_1 as a variable and evaluating the string "c:\users\xyz\appdata\roaming\123456789_kjl.jpg". I played around with the name of my variable and moved around the underscore to ensure I was correct in my interpretation of what is happening.

I can't figure out how to get the command line to evaluate e_1's value. I also tried fb.TitleFormat("$strrchr($get(e_1)),_)").Eval(); but that didn't work either. I'm probably missing something simple as usual, but I can't figure it out. Thanks for any advice!

This post has been edited by godrick: Sep 13 2012, 02:22
Go to the top of the page
+Quote Post
marc2003
post Sep 13 2012, 10:21
Post #1821





Group: Members
Posts: 4446
Joined: 27-January 05
From: England
Member No.: 19379



e_1 is your variable in the script but you're treating it as a plain text in your title formatting.

but you don't even need to use title formatting for this. javascript has indexOf.

y4 = e_1.indexOf("_");
Go to the top of the page
+Quote Post
sylla
post Sep 13 2012, 10:34
Post #1822





Group: Members
Posts: 133
Joined: 7-March 07
Member No.: 41266



I've got a suggestion for your "now playing" script marc2003.

Since it shows album art, I now use this panel instead of the album art viewer, the only downside is it takes a couple of clicks more to come to the directory of the currently playing track.

It's nice to be able to find the artist picture folder by double clicking, but if I double click on the albumart I would like to come to that directory instead. Just an idea, that I think makes sense?
Go to the top of the page
+Quote Post
marc2003
post Sep 13 2012, 10:57
Post #1823





Group: Members
Posts: 4446
Joined: 27-January 05
From: England
Member No.: 19379



that's a reasonable request. samples updated: http://dl.dropbox.com/u/22801321/samples.zip

now playing: double clicking the album art image locates the image in explorer. double clicking anywhere else in the panel opens the artist image.
Go to the top of the page
+Quote Post
sylla
post Sep 13 2012, 11:11
Post #1824





Group: Members
Posts: 133
Joined: 7-March 07
Member No.: 41266



wow, that's fast smile.gif thanks!
Go to the top of the page
+Quote Post
godrick
post Sep 13 2012, 13:07
Post #1825





Group: Members
Posts: 305
Joined: 31-December 10
Member No.: 86948



QUOTE (marc2003 @ Sep 13 2012, 10:21) *
e_1 is your variable in the script but you're treating it as a plain text in your title formatting.

but you don't even need to use title formatting for this. javascript has indexOf.

y4 = e_1.indexOf("_");


Yes, marc2003 you are correct in describing the problem, and using javascript string object methods in this example does work. But I've got other sting formatting actions I'm trying to do that either require me to figure out a way to have e_1 recognized correctly in a fb.titleformat expression, or at least seem easier with title formatting than with javascript string object methods. I've successfully passed variables to fb.titleformat expressions previously and even in other places in the script I'm working on, but none of the other expressions involve string formatting - is there something I need to do in this or similar cases to have the variable recognized as such? Thanks for the help!
Go to the top of the page
+Quote Post

125 Pages V  « < 71 72 73 74 75 > » 
Reply to this topicStart new topic
3 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
1 Members: tarkus721

 



RSS Lo-Fi Version Time is now: 21st August 2014 - 04:13