IPB

Welcome Guest ( Log In | Register )

125 Pages V  « < 89 90 91 92 93 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help.
colagen
post Apr 10 2013, 10:41
Post #2251





Group: Members
Posts: 18
Joined: 2-December 11
Member No.: 95540



Hi,

Does someone know a way to display a simple dialog box, with two button yes/No, and use the result in a WSH script ?
(I'm adding a menu for quick tagging things like genre, date, but i want to avoid bad clics and get all my library re-tagged..)
Go to the top of the page
+Quote Post
marc2003
post Apr 10 2013, 11:02
Post #2252





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



you need to disable safe mode in the preferences for this to work.

put this code somewhere and don't edit it
CODE
var vb = new ActiveXObject("ScriptControl");
vb.Language = "VBScript";

function MsgBox(prompt, buttons, title) {
    prompt = prompt.replace(/"/g, '" + Chr(34) + "');
    prompt = prompt.replace(/\n/g, '" + Chr(13) + "');
    title = title.replace(/"/g, '" + Chr(34) + "');
    return vb.eval('MsgBox' + '("' + prompt + '", "' + buttons + '", "' + title + '")');
}


now you can use some custom code like this.

CODE
var result = MsgBox("Open preferences?", 4, "Question");
if (result == 6) fb.ShowPreferences();


note i passed 4 as the buttons argument. that's a simple Yes/no. i check to see if the result was 6 because that means Yes was clicked.

see all codes here- http://msdn.microsoft.com/en-us/library/sf...v=vs.84%29.aspx
Go to the top of the page
+Quote Post
tedgo
post Apr 10 2013, 11:25
Post #2253





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



Is there any way to apply actions with a button for a bunch of files instead of only one selected or nowplaying?
Like File Operations/Delete files or tagging actions

For now i tried with fb.RunContextCommandWithMetadb(..., fb.GetFocusItem()) but it only applies to the first file of a selection...

This post has been edited by tedgo: Apr 10 2013, 11:26
Go to the top of the page
+Quote Post
marc2003
post Apr 10 2013, 11:29
Post #2254





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



fb.GetSelections()
Go to the top of the page
+Quote Post
tedgo
post Apr 10 2013, 11:30
Post #2255





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



Instead of fb.GetFocusItem()
Is it new? (i haven't engaged with wsh panel mod's new interfaces for a long time...)

EDIT: Thanks btw. ... wink.gif

This post has been edited by tedgo: Apr 10 2013, 11:32
Go to the top of the page
+Quote Post
marc2003
post Apr 10 2013, 11:34
Post #2256





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



it's been around since 1.4.0 so quite awhile.

one other thing you might find useful is the flags..

CODE
    // [1.4.0] Changed: Accept IFbMetadbHandleList interface for metadb handle list.
    // [1.5.0 Preview 2] Changed: Add new "flags" parameter
    // flags:   0 - default (depends on whether SHIFT key is pressed, flag_view_reduced or flag_view_full is selected)
    //          4 - flag_view_reduced
    //          8 - flag_view_full
    boolean RunContextCommandWithMetadb(command, handle_or_handles, flags = 0);


if you set it to 8, it will even work on context commands that have been hidden by the user. i've found it very handy as people generally like to hide the foo_customdb/last.fm options used by my last.fm playcount script.

This post has been edited by marc2003: Apr 10 2013, 11:40
Go to the top of the page
+Quote Post
tedgo
post Apr 10 2013, 11:38
Post #2257





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



Oh, then i must have overread it all the time (or confused with GetSelection...)

EDIT (according to yours):
Wow, i should really read the interfaces.html carefully and play with all the new unknown stuff smile.gif

This post has been edited by tedgo: Apr 10 2013, 11:47
Go to the top of the page
+Quote Post
marc2003
post Apr 10 2013, 12:18
Post #2258





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



dropbox are now using a new domain/URL re-direction which has broken my update script feature. i've had to make changes which need to be downloaded manually.

snippet from changelog:

QUOTE
10.04.2013.01

Due to recent changes made by dropbox, you may see
"HTTP error: 0" in your foobar2000 console when trying to run
"Update script". The only way around this is to download this
file manually and save it in the "marc2003" folder.

https://dl.dropboxusercontent.com/u/2280132...2003/common7.js


this only affects people using the full zip posted on or after the 2nd april. previous versions don't update any more.

the full download is available here: https://dl.dropboxusercontent.com/u/22801321/samples.zip

This post has been edited by marc2003: Apr 10 2013, 12:22
Go to the top of the page
+Quote Post
colagen
post Apr 10 2013, 12:30
Post #2259





Group: Members
Posts: 18
Joined: 2-December 11
Member No.: 95540



QUOTE (marc2003 @ Apr 10 2013, 11:02) *
you need to disable safe mode in the preferences for this to work.

put this code somewhere and don't edit it
CODE
var vb = new ActiveXObject("ScriptControl");
vb.Language = "VBScript";

function MsgBox(prompt, buttons, title) {
    prompt = prompt.replace(/"/g, '" + Chr(34) + "');
    prompt = prompt.replace(/\n/g, '" + Chr(13) + "');
    title = title.replace(/"/g, '" + Chr(34) + "');
    return vb.eval('MsgBox' + '("' + prompt + '", "' + buttons + '", "' + title + '")');
}


now you can use some custom code like this.

CODE
var result = MsgBox("Open preferences?", 4, "Question");
if (result == 6) fb.ShowPreferences();


note i passed 4 as the buttons argument. that's a simple Yes/no. i check to see if the result was 6 because that means Yes was clicked.

see all codes here- http://msdn.microsoft.com/en-us/library/sf...v=vs.84%29.aspx


Thanks a lot, this code snippet which allow to use vbscript functions will be useful fore sure
Go to the top of the page
+Quote Post
colagen
post Apr 10 2013, 14:15
Post #2260





Group: Members
Posts: 18
Joined: 2-December 11
Member No.: 95540



And do you know a way to open the properties dialog ? (The one you see when you right-click selected items in a playlist)
Go to the top of the page
+Quote Post
marc2003
post Apr 10 2013, 15:00
Post #2261





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



my post just up the page shows the documentation for that.

http://www.hydrogenaudio.org/forums/index....st&p=830729

in your case, the command would simply be "Properties".
Go to the top of the page
+Quote Post
colagen
post Apr 10 2013, 22:50
Post #2262





Group: Members
Posts: 18
Joined: 2-December 11
Member No.: 95540



Okey, thanks. Now, it seems pretty obvious, shame on me for missing it (maybe the documentation should include some basic descriptions of each functions utility)
Go to the top of the page
+Quote Post
VlaKor
post Apr 13 2013, 19:57
Post #2263





Group: Members
Posts: 10
Joined: 13-April 13
Member No.: 107650





Help please.

This post has been edited by VlaKor: Apr 13 2013, 19:59
Go to the top of the page
+Quote Post
marc2003
post Apr 13 2013, 22:21
Post #2264





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



i just tested my musicbrainz script with Iron Maiden set as the artist and it works for me so something must have have corrupted the download of the file??

you can force a fresh download by doing this.

-first of all close foobar
-browse your foobar2000 profile folder in explorer and into the wsh_lastfm folder.
-search for and delete all files named musicbrainz_URLs.json
-lastly open internet explorer and clear the temporary files. (even if you don't use the browser, it still caches data used by my scripts so it needs to be cleared.)

now start foobar and a fresh copy should be downloaded.

edit: completely unrelated to this but discogs seems to be having major server problems at the moment. if anybody finds my script not updating/working, you now know why.

This post has been edited by marc2003: Apr 13 2013, 22:51
Go to the top of the page
+Quote Post
Reith
post Apr 16 2013, 01:31
Post #2265





Group: Members
Posts: 33
Joined: 11-July 09
From: California
Member No.: 71369



I just did an update of the scripts and now they all crash.

Error: WSH Panel Mod (Art Reader by marc2003): Microsoft JScript runtime error:
'panel' is undefined
File: <main>
Ln: 9, Col: 1
<source text only available at compile time>

Did I mess something up?
Go to the top of the page
+Quote Post
marc2003
post Apr 16 2013, 01:57
Post #2266





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



when i do major updates, files inside the marc2003 folder change so you just need to extract it again.

if you think you have extracted it, then you've put it in the wrong place. the readme will tell you.

This post has been edited by marc2003: Apr 16 2013, 01:58
Go to the top of the page
+Quote Post
Reith
post Apr 16 2013, 02:03
Post #2267





Group: Members
Posts: 33
Joined: 11-July 09
From: California
Member No.: 71369



Did you do another major update after the one on April 10? I manually extracted and replaced everything then and it was working fine until today.

EDIT: Never mind, I fixed it. Looks like the common7.js file somehow got screwed up when I ran the update scripts command. It was only 1 kb so obviously something was wrong. I just replaced it manually and it's ok now.

This post has been edited by Reith: Apr 16 2013, 02:05
Go to the top of the page
+Quote Post
marc2003
post Apr 16 2013, 02:21
Post #2268





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



sorry about that. it looks like i need to do some more robust checking on file contents before over-writing existing files. i rely on the http server response code of 200 (which means "OK") from dropbox and assume it's safe to update if version numbers don't match. obviously it went a bit wrong when you did your update.

edit: i've now put some checking in. here's a direct link in case you don't trust Update script in the current version. tongue.gif

https://dl.dropboxusercontent.com/u/2280132...2003/common7.js

This post has been edited by marc2003: Apr 16 2013, 02:53
Go to the top of the page
+Quote Post
millzeyweb
post Apr 17 2013, 00:59
Post #2269





Group: Members
Posts: 3
Joined: 4-May 12
Member No.: 99480



Hi Marc,

I'd like to say that your work with wsh/fb2k sure is appreciated by many and myself, and you are quite generous in helping others with questions.

I was wondering if you would you be so kind as to help me with a minor change to "nowplaying". I need the ratings stars to read/edit a custom metatag instead of the playback statistics db or standard "rating" metatag as it currently does. I found a post where someone asked the same, but it was many versions ago and didnt apply to your much updated lib and script.

Many thanks
Go to the top of the page
+Quote Post
marc2003
post Apr 17 2013, 03:08
Post #2270





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



i couldn't be bothered to implement it properly (such as giving people a choice between foo_playcount or file tags) so i just did a quick bodge job.

https://dl.dropboxusercontent.com/u/2280132...ating%20tag.txt

Go to the top of the page
+Quote Post
millzeyweb
post Apr 17 2013, 05:07
Post #2271





Group: Members
Posts: 3
Joined: 4-May 12
Member No.: 99480



QUOTE (marc2003 @ Apr 16 2013, 21:08) *
i couldn't be bothered to implement it properly (such as giving people a choice between foo_playcount or file tags) so i just did a quick bodge job.

https://dl.dropboxusercontent.com/u/2280132...ating%20tag.txt


1000 thank you very muches
Go to the top of the page
+Quote Post
marc2003
post Apr 17 2013, 13:23
Post #2272





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



i don't really use my discogs script much but added it today and noticed it's returns anything containing the search term. i've changed it to filter out all the results that don't exactly match.

this is a before/after screenshot. https://dl.dropboxusercontent.com/u/2280132...ril/discogs.png

if this causes issues, i might make an option to toggle the behaviour on/off.

just right click>Update script.

if nothing happens check the foobar console. if it's http error code 0, you should see the changelog entry dated 10.04.2013

https://dl.dropboxusercontent.com/u/2280132...h/changelog.txt

if it's a 404 error, your package is out of date and you need extract the full zip and update the scripts in the panels.

https://dl.dropboxusercontent.com/u/22801321/samples.zip

new users should also download this zip and there are full instructions inside.
Go to the top of the page
+Quote Post
matav
post Apr 17 2013, 14:32
Post #2273





Group: Members
Posts: 133
Joined: 27-November 10
From: Earth
Member No.: 86055



is it possible to have individual right-click context menus for different buttons in the same WSH panel?

i plan to make a simple playback panel with the usual play, pause, stop, prev, next.
> the Play button will have "Play random track" in it's right-context menu
> the Stop button will have "Stop after current"
> the Next button will have the 3 Shuffle playback orders

also i have been wondering if this can be achieved with a <keyboardKey + mouseClick> event so i can do a shift+mouseLeftClick
--
i am not much of a WSH coder so i'd like to know upfront if this is possible before i set out on a wild goose chase
ermm.gif

This post has been edited by matav: Apr 17 2013, 14:33


--------------------
try my portable foobar theme -- eXdb v4d
http://bit.ly/matavfb
Go to the top of the page
+Quote Post
marc2003
post Apr 17 2013, 14:40
Post #2274





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



yes that's definitely possible.

this is the callback for a left mouse click and you can check whether shift was held.

CODE
function on_mouse_lbtn_up(x, y) {
    if (utils.IsKeyPressed(0x10)) {
        //shift key was pressed. do something
    } else {
        //do something else
    }
}


This post has been edited by marc2003: Apr 17 2013, 14:42
Go to the top of the page
+Quote Post
matav
post Apr 17 2013, 15:41
Post #2275





Group: Members
Posts: 133
Joined: 27-November 10
From: Earth
Member No.: 86055



QUOTE (marc2003 @ Apr 17 2013, 14:40) *
yes that's definitely possible.

great!
--
thanks for the help marc, much appreciated.


--------------------
try my portable foobar theme -- eXdb v4d
http://bit.ly/matavfb
Go to the top of the page
+Quote Post

125 Pages V  « < 89 90 91 92 93 > » 
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd August 2014 - 14:36