IPB

Welcome Guest ( Log In | Register )

120 Pages V  « < 73 74 75 76 77 > »   
Reply to this topicStart new topic
WSH Panel Mod script discussion/help.
romka18
post Oct 15 2012, 12:18
Post #1851





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



can i get somewhere windows8 metro desktop colors of current user?
Go to the top of the page
+Quote Post
WilB
post Oct 15 2012, 12:51
Post #1852





Group: Members
Posts: 259
Joined: 20-July 06
Member No.: 33113



@marc2003

I am probably doing something stupid, but I cannot get the allmusic script to work even for popular albums that are at the allmusic site. Can you confirm that the actual foo_allmusic_mod.vbs and allmusic.txt scripts in the recent download link of post #1845 are the correct ones and working? I always get [fetching info] followed by [nothing found]. Or do you have any other suggestions or special instructions? The other internet search scripts like musicbrainz.txt & news-reviews-blogs.txt work fine.

This post has been edited by WilB: Oct 15 2012, 12:59
Go to the top of the page
+Quote Post
PeteG
post Oct 15 2012, 16:43
Post #1853





Group: Members
Posts: 52
Joined: 10-June 12
From: Denmark
Member No.: 100577



@marc2003

Thank you for the reply.
Yes, I was talking about your very useful allmusic script; as it by nature is dual mode I have implemented it in two WSH Panel Mod tabs: AMG bio/AMG review). A third tab is used for another of your charms, Musicbrainz Releases.
Offline reading in fb2k is really time-saving!
Getting back on topic: I will dig deeper into allmusic.txt, common4.js, and your modded version of romor's foo_allmusic.vbs to get a better understanding of what's happening. Plus of course the WSH Panel Mod documentation.
I'll be back, as someone once said in a movie.
Go to the top of the page
+Quote Post
marc2003
post Oct 16 2012, 10:47
Post #1854





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



@romka18, maybe utils.GetSysColor(x). x is number, range 0 to 30 i *think*

@WilB, i doubt you're doing anything wrong - it does seem a bit temporamental. all i can suggest is try clearing the IE browser cache through its options and trying again.

@PeteG, in the allmusic script, inside the on_paint function, replace the default: section with this...

CODE
            gr.GdiDrawText(g_text, normal_font, g_textcolor, 6, 45 - (offset * row_height), ww - 16, text_rows * row_height, DT_WORDBREAK | DT_CALCRECT | DT_NOPREFIX);
            gr.FillSolidRect(0, 0, ww, 45, g_backcolor);
            gr.FillSolidRect(0, wh - 15, ww, 15, g_backcolor);
            gr.GdiDrawText(allmusic_type == 1 ? "Allmusic review" : "Allmusic bio", title_font, g_textcolor_hl, 6, 6, ww - 77, 24, DT_VCENTER | DT_END_ELLIPSIS | DT_CALCRECT | DT_NOPREFIX);
            gr.DrawLine(5, 29, ww - 10, 29, 1, g_textcolor_hl);
            up_btn.draw(gr);
            down_btn.draw(gr);


it seems ok on XP. i can't test on vista/7 at tmoment.
Go to the top of the page
+Quote Post
deathrune666
post Oct 16 2012, 17:49
Post #1855





Group: Members
Posts: 8
Joined: 13-October 12
Member No.: 103837



hi please could someone post a nice volume bar script? smile.gif
Go to the top of the page
+Quote Post
PeteG
post Oct 17 2012, 03:52
Post #1856





Group: Members
Posts: 52
Joined: 10-June 12
From: Denmark
Member No.: 100577



QUOTE (marc2003 @ Oct 16 2012, 11:47) *
@PeteG, in the allmusic script, inside the on_paint function, replace the default: section with this...

Yes! Colour me impressed! Thank you very much, marc2003.
Your new code snippet is doing the job flawlessly, except for a minor drawback: words compounded with a hyphen - record-making, fine-tuning
- are no longer wrapped after the hyphen, they are sent to the next line as a whole. It's just an observation. I've got precisely what I
asked for and I'm a happy man.
Dare I suggest that you put the new lines in the allmusic scipt, commented out and with a single line of explanation (I mean, why waste good
code)? Or am I the only person on Planet Earth with these nitpicking idiosynchrasies in regard of parentheses and quotation marks?

By the way: I haven't got the faintest idea of what's happing. I can see the difference between the new and the old default: section,
that's all. I have a long piece of homework to do, I guess. In the end DIYing is (well, can be) much more satisfying than begging others for
help. But for now GDI coding is close to Sanskrit in my view; my old arteries a hardening just fine, thank you.

QUOTE (marc2003 @ Oct 16 2012, 11:47) *
it seems ok on XP. i can't test on vista/7 at tmoment.

On Vista 32-bit and 7 64-bit: Tested & Passed. foobar2000 1.1.15, WSH Panel Mod 1.5.6.
I created two Popup Panels (v0.1.4) each with an instance of WSH PM, one running the old allmusic script, the other the new script.
And did a lot of resizing the panels.

This post has been edited by PeteG: Oct 17 2012, 03:55
Go to the top of the page
+Quote Post
marc2003
post Oct 17 2012, 10:22
Post #1857





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



i can improve the snippet i posted above. it's bit of an ugly hack but the main thing i wanted to test was appearance. now that's confirmed ok, i'll be updating all my scripts. infact i'm giving them all a major overhaul so it'll be a few weeks before i post the new version.

edit: samples updated with an updated allmusic script. just the marc2003 folder needs extracting. the script in the panel doesn't need updating. thanks to romor again - this is definitely working more consistently than before.

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



This post has been edited by marc2003: Oct 17 2012, 10:57
Go to the top of the page
+Quote Post
godrick
post Oct 17 2012, 13:30
Post #1858





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



Argh - struggling to capture in a js script the maximum pixel resolution of a display. I thought window.MaxWidth was the correct command, but it returns a nonsensical answer of 2147483647. I tried window.width and it returns the correct pixel width of my current display window and correctly changes as I resize that window, so I would expect MaxWidth to also return a pixel width. For what it's worth, window.MaxHeight returns the same value of 2147483647 that I don't understand, while window.Height correctly returns the pixel height of my display window. Any advice appreciated!
Go to the top of the page
+Quote Post
marc2003
post Oct 17 2012, 13:38
Post #1859





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



use utils.GetSystemMetrics....

CODE
fb.trace(utils.GetSystemMetrics(16) + "x" + utils.GetSystemMetrics(17));


edit: this only gets the current resolution. i'm not sure if you can query what your monitor actually supports if you're running at a lower res.

window.Width and window.Height are the dimensions of the panel.

window.max/min width/height are for setting the max/min panel heights. this is useful if you want to lock the size.

This post has been edited by marc2003: Oct 17 2012, 13:41
Go to the top of the page
+Quote Post
godrick
post Oct 17 2012, 13:49
Post #1860





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



Works great, and thanks for the explanation as well.
Go to the top of the page
+Quote Post
Gjorgjevski
post Oct 17 2012, 14:18
Post #1861





Group: Members
Posts: 6
Joined: 17-October 12
Member No.: 103913



QUOTE (godrick @ Oct 17 2012, 13:30) *
I thought window.MaxWidth was the correct command, but it returns a nonsensical answer of 2147483647.

Heh, it is not really a nonsensical answer. 2 147 483 647 (231 − 1) is the maximum value that 32-bit signed integer can have wink.gif
Go to the top of the page
+Quote Post
romka18
post Oct 18 2012, 10:21
Post #1862





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



2marc2003
no, GetSysColor() returns this colors:

but i try to get this ones:

i searched it in registry but didnt find them.

This post has been edited by romka18: Oct 18 2012, 10:27
Go to the top of the page
+Quote Post
Elevory
post Oct 19 2012, 07:49
Post #1863





Group: Members
Posts: 12
Joined: 24-September 11
Member No.: 93932



Is there a script that replicates the information shown by CUI's Status Pane? I'd like to study such a thing for my own learning purposes.
Go to the top of the page
+Quote Post
Falstaff
post Oct 20 2012, 09:12
Post #1864





Group: Members
Posts: 2797
Joined: 12-November 06
Member No.: 37463



QUOTE (Elevory @ Oct 19 2012, 08:49) *
Is there a script that replicates the information shown by CUI's Status Pane? I'd like to study such a thing for my own learning purposes.


i've done a close thing for a config, but it's more the status bar than the status pane, get it and check the script here : http://fav.me/d4maqsc

This post has been edited by Falstaff: Oct 20 2012, 09:12


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
MordredKLB
post Nov 2 2012, 22:19
Post #1865





Group: Members
Posts: 192
Joined: 1-May 09
From: Austin, TX
Member No.: 69413



I'm trying to use utils.glob to return directories in a path, instead of files in the path. This appears to be possible based off of the FILE_ATTRIBUTE_DIRECTORY flag, but it doesn't seem to work. I've tried passing:
"C:\\temp\\"
"C:\\temp\\*"
"C:\\temp\\*."
"C:\\temp\\."

etc. and I only get the files in that path, but never the directories in that path which is all I want. I've tried some of the other flags, but still no joy.

Anybody have any ideas?

This post has been edited by MordredKLB: Nov 2 2012, 22:19
Go to the top of the page
+Quote Post
godrick
post Nov 3 2012, 02:41
Post #1866





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



I don't know of an elegant approach, but a crude method that works is to use utils.glob to grab the full file paths, then whack everything from the right up to the first \ for each array element, and then use a duplicate elimination function borrowed from ojdo's HTPC scripts with which you're probably familiar:
CODE
function eliminateDuplicates(arr) {
var i,
len = arr.length,
out = [],
obj = {};

for (i=0; i<len; i++) {
obj[arr[i]] = 0;
}
for (i in obj) {
out.push(i);
}
return out;
}




Go to the top of the page
+Quote Post
marc2003
post Nov 3 2012, 11:31
Post #1867





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



http://msdn.microsoft.com/en-us/library/e1...v=vs.84%29.aspx
Go to the top of the page
+Quote Post
Gjorgjevski
post Nov 5 2012, 01:19
Post #1868





Group: Members
Posts: 6
Joined: 17-October 12
Member No.: 103913



Any idea why I get an “invalid pointer” error on line 19 ever now and then (it has happened 3 times in 2 and a half months)?
Go to the top of the page
+Quote Post
Manchesterer
post Nov 5 2012, 13:21
Post #1869





Group: Members
Posts: 24
Joined: 2-August 11
Member No.: 92721



Help welcome - I recently updated obsolete timer functions in all my scripts, only below script refuses to work when I replace window.CreateTimerInterval with window.SetInterval.
I'm a non-coder, so you're welcome to point out my mistakes, important stuff missing, redundant stuff, runaway timers, endless loops etc.
CODE
// ==PREPROCESSOR==
// @name "Cover Panel" by Br3tt, mod by Zin-Uru, mod by TEA
// ==/PREPROCESSOR==

var g_tooltip = window.CreateTooltip();
var hover = null;
var g_img = null;

cover = function () {
this.reset = function () {
this.x = 0;
this.y = 0;
}
this.update = function () {
this.x = img_info.x;
this.y = img_info.y;
}
this.swap = function (cover_source) {
this.image = cover_source.image;
this.x = cover_source.x;
this.y = cover_source.y;
}
}

var covers = Array(new cover, new cover);
var fader = 0;
var alphamax = 255;
var fading_step = 15.0;
var g_timer;
var g_refresh_timer = 40;
var g_metadb;
var is_stream = false;
var is_embedded;
var is_art;
var art_path = "";
var WshShell = new ActiveXObject("WScript.Shell");
var bg_dir = fb.FoobarPath + "\\skin\\";
var id = 0;
var img_info = {x: 0, y: 0, w: 0, h: 0};

function FormatImage(image, iw, ih) {
if (!image || !iw || !ih) return image;

var scale_w = ww / image.Width;
var scale_h = wh / image.Height;
var scale = Math.min(scale_w, scale_h);
var pos_x = 0,
pos_y = 0;
img_info.w = iw;
img_info.h = ih;

if (scale_w < scale_h) pos_y = (wh - image.height * scale) / 2;
else if (scale_w > scale_h) pos_x = (ww - image.Width * scale) / 2;

var tmp_img = gdi.CreateImage(img_info.w, img_info.h);
var gp = tmp_img.GetGraphics();
gp.DrawImage(image, pos_x, pos_y, image.Width * scale, image.Height * scale, 0, 0, image.Width, image.Height);
tmp_img.ReleaseGraphics(gp);
CollectGarbage();
return tmp_img;
}

function refresh_cover() {
covers[0].swap(covers[1]);
covers[1].reset();

if (fb.PlaybackLength > 0 || !fb.IsPlaying) {
is_stream = false;

g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
if (!g_metadb) {
on_playback_stop(4);
return;
}
utils.GetAlbumArtAsync(window.ID, g_metadb, 0);

is_embedded = false;
if (g_metadb) {
covers[1].image = FormatImage(utils.GetAlbumArtEmbedded(g_metadb.rawpath, 0), ww, wh, 7, 1, 0);
g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, 0);
covers[1].update();
if (covers[1].image) {
is_embedded = true;
is_art = false;
} else {
covers[1].image = FormatImage(utils.GetAlbumArtV2(g_metadb, 0), ww, wh, 7, 1, 0);
g_img = utils.GetAlbumArtV2(g_metadb, 0);
covers[1].update();
if (!covers[1].image) {
is_art = false;
covers[1].image = FormatImage(gdi.Image(bg_dir + "no_cover.jpg"), ww, wh, 7, 1, 0);
covers[1].update();
}
}
}

} else if (fb.IsPlaying && fb.TitleFormat("$right($left(%path%,2),1)").Eval() != ":") {
is_art = false;
is_stream = true;
covers[1].image = FormatImage(gdi.Image(bg_dir + "stream.jpg"), ww, wh, 7, 1, 0);
covers[1].update();
}
window.Repaint();
}

function on_timer(id) {
if (g_timer) {
if (id == g_timer.ID) {
fader = (fader > 0) ? fader - fading_step : 0;
if (fader <= 0) g_timer && window.KillTimer(g_timer);
window.Repaint();
}
}
}

function on_playback_stop(reason) {
if (reason == 4 || (reason == 0 && !is_art)) {
covers[0].swap(covers[1]);
covers[1].image = FormatImage(gdi.Image(bg_dir + "no_cover.jpg"), ww, wh, 7, 1, 0);
covers[1].update();
fader = alphamax;
g_img = null;
g_timer = window.CreateTimerInterval(g_refresh_timer);
}
if (reason == 1 || reason == 0) {
refresh_cover();
}
}

function on_playback_new_track(info) {
refresh_cover();
fader = alphamax;
g_timer = window.CreateTimerInterval(g_refresh_timer);
}

function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, 0xFF000000);
if (fader > 0) covers[0].image && gr.DrawImage(covers[0].image, covers[0].x, covers[0].y, covers[0].image.Width, covers[0].image.Height, 0, 0, covers[0].image.Width, covers[0].image.Height, 0, fader);
covers[1].image && gr.DrawImage(covers[1].image, covers[1].x, covers[1].y, covers[1].image.Width, covers[1].image.Height, 0, 0, covers[1].image.Width, covers[1].image.Height, 0, 255 - fader);
}

function on_size() {
ww = window.Width;
wh = window.Height;
refresh_cover();
}

function on_item_focus_change() {
if (!fb.IsPlaying) {
refresh_cover();
fader = alphamax;
g_timer = window.CreateTimerInterval(g_refresh_timer);
}
}

function on_playlists_changed() {
if (!fb.IsPlaying) on_item_focus_change();
}

function on_get_album_art_done(metadb, art_id, image, image_path) {
art_path = image_path;
}

function on_mouse_lbtn_down(x, y) {
var meta = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();

if (!meta || !is_art) return;
switch (true) {
case(art_path == ""):
break;
default:
// WshShell.run('"JPEGView.exe"' + '"' + art_path + '"');
break;
}
}

function on_mouse_move(x, y) {
if (!hover && g_img) {
g_tooltip.Text = (is_embedded ? "Embedded - " : "External - ") + g_img.Width + " x " + g_img.Height;
g_tooltip.Activate();
hover = true;
}
}

function on_mouse_leave() {
g_tooltip.Deactivate();
hover = null;
}
Go to the top of the page
+Quote Post
Falstaff
post Nov 5 2012, 16:20
Post #1870





Group: Members
Posts: 2797
Joined: 12-November 06
Member No.: 37463



here is the modded version with new timer api

CODE

// ==PREPROCESSOR==
// @name "Cover Panel" by Br3tt, mod by Zin-Uru, mod by TEA
// ==/PREPROCESSOR==

var g_tooltip = window.CreateTooltip();
var hover = null;
var g_img = null;

cover = function () {
this.reset = function () {
this.x = 0;
this.y = 0;
}
this.update = function () {
this.x = img_info.x;
this.y = img_info.y;
}
this.swap = function (cover_source) {
this.image = cover_source.image;
this.x = cover_source.x;
this.y = cover_source.y;
}
}

var covers = Array(new cover, new cover);
var fader = 0;
var alphamax = 255;
var fading_step = 15.0;
var g_timer = false;
var g_refresh_timer = 40;
var g_metadb;
var is_stream = false;
var is_embedded;
var is_art;
var art_path = "";
var WshShell = new ActiveXObject("WScript.Shell");
var bg_dir = fb.FoobarPath + "\\skin\\";
var id = 0;
var img_info = {x: 0, y: 0, w: 0, h: 0};

function FormatImage(image, iw, ih) {
if (!image || !iw || !ih) return image;

var scale_w = ww / image.Width;
var scale_h = wh / image.Height;
var scale = Math.min(scale_w, scale_h);
var pos_x = 0,
pos_y = 0;
img_info.w = iw;
img_info.h = ih;

if (scale_w < scale_h) pos_y = (wh - image.height * scale) / 2;
else if (scale_w > scale_h) pos_x = (ww - image.Width * scale) / 2;

var tmp_img = gdi.CreateImage(img_info.w, img_info.h);
var gp = tmp_img.GetGraphics();
gp.DrawImage(image, pos_x, pos_y, image.Width * scale, image.Height * scale, 0, 0, image.Width, image.Height);
tmp_img.ReleaseGraphics(gp);
CollectGarbage();
return tmp_img;
}

function refresh_cover() {
covers[0].swap(covers[1]);
covers[1].reset();

if (fb.PlaybackLength > 0 || !fb.IsPlaying) {
is_stream = false;

g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
if (!g_metadb) {
on_playback_stop(4);
return;
}
utils.GetAlbumArtAsync(window.ID, g_metadb, 0);

is_embedded = false;
if (g_metadb) {
covers[1].image = FormatImage(utils.GetAlbumArtEmbedded(g_metadb.rawpath, 0), ww, wh, 7, 1, 0);
g_img = utils.GetAlbumArtEmbedded(g_metadb.rawpath, 0);
covers[1].update();
if (covers[1].image) {
is_embedded = true;
is_art = false;
} else {
covers[1].image = FormatImage(utils.GetAlbumArtV2(g_metadb, 0), ww, wh, 7, 1, 0);
g_img = utils.GetAlbumArtV2(g_metadb, 0);
covers[1].update();
if (!covers[1].image) {
is_art = false;
covers[1].image = FormatImage(gdi.Image(bg_dir + "no_cover.jpg"), ww, wh, 7, 1, 0);
covers[1].update();
}
}
}

} else if (fb.IsPlaying && fb.TitleFormat("$right($left(%path%,2),1)").Eval() != ":") {
is_art = false;
is_stream = true;
covers[1].image = FormatImage(gdi.Image(bg_dir + "stream.jpg"), ww, wh, 7, 1, 0);
covers[1].update();
}
window.Repaint();
}

function on_playback_stop(reason) {
if (reason == 4 || (reason == 0 && !is_art)) {
covers[0].swap(covers[1]);
covers[1].image = FormatImage(gdi.Image(bg_dir + "no_cover.jpg"), ww, wh, 7, 1, 0);
covers[1].update();
fader = alphamax;
g_img = null;
g_timer && window.ClearInterval(g_timer);
g_timer = false;
g_timer = window.SetInterval(function () {
fader = (fader > 0) ? fader - fading_step : 0;
if (fader <= 0) {
g_timer && window.ClearInterval(g_timer);
g_timer = false;
}
window.Repaint();
}, g_refresh_timer);
}
if (reason == 1 || reason == 0) {
refresh_cover();
}
}

function on_playback_new_track(info) {
refresh_cover();
fader = alphamax;
g_timer && window.ClearInterval(g_timer);
g_timer = false;
g_timer = window.SetInterval(function () {
fader = (fader > 0) ? fader - fading_step : 0;
if (fader <= 0) {
g_timer && window.ClearInterval(g_timer);
g_timer = false;
}
window.Repaint();
}, g_refresh_timer);
}

function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, 0xFF000000);
if (fader > 0) covers[0].image && gr.DrawImage(covers[0].image, covers[0].x, covers[0].y, covers[0].image.Width, covers[0].image.Height, 0, 0, covers[0].image.Width, covers[0].image.Height, 0, fader);
covers[1].image && gr.DrawImage(covers[1].image, covers[1].x, covers[1].y, covers[1].image.Width, covers[1].image.Height, 0, 0, covers[1].image.Width, covers[1].image.Height, 0, 255 - fader);
}

function on_size() {
ww = window.Width;
wh = window.Height;
refresh_cover();
}

function on_item_focus_change() {
if (!fb.IsPlaying) {
refresh_cover();
fader = alphamax;
g_timer && window.ClearInterval(g_timer);
g_timer = false;
g_timer = window.SetInterval(function () {
fader = (fader > 0) ? fader - fading_step : 0;
if (fader <= 0) {
g_timer && window.ClearInterval(g_timer);
g_timer = false;
}
window.Repaint();
}, g_refresh_timer);
}
}

function on_playlists_changed() {
if (!fb.IsPlaying) on_item_focus_change();
}

function on_get_album_art_done(metadb, art_id, image, image_path) {
art_path = image_path;
}

function on_mouse_lbtn_down(x, y) {
var meta = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();

if (!meta || !is_art) return;
switch (true) {
case(art_path == ""):
break;
default:
// WshShell.run('"JPEGView.exe"' + '"' + art_path + '"');
break;
}
}

function on_mouse_move(x, y) {
if (!hover && g_img) {
g_tooltip.Text = (is_embedded ? "Embedded - " : "External - ") + g_img.Width + " x " + g_img.Height;
g_tooltip.Activate();
hover = true;
}
}

function on_mouse_leave() {
g_tooltip.Deactivate();
hover = null;
}


--------------------
http://br3tt.online.fr/
Go to the top of the page
+Quote Post
MordredKLB
post Nov 5 2012, 16:43
Post #1871





Group: Members
Posts: 192
Joined: 1-May 09
From: Austin, TX
Member No.: 69413



QUOTE (godrick @ Nov 2 2012, 20:41) *
I don't know of an elegant approach, but a crude method that works is to use utils.glob to grab the full file paths, then whack everything from the right up to the first \ for each array element, and then use a duplicate elimination function borrowed from ojdo's HTPC scripts with which you're probably familiar:

I'm very familiar with ojdo's script (the one I'm working on is a HEAVILY modified version of his) but the remove duplicates function wouldn't really work for me. The problem was that I wanted to use wildcards in the folder paths. My use case is that I wanted to be able to detect other versions of an album on my hard drive. My folder naming convention is always the same, but I'll use differentiator tags at the end to denote other things. i.e. %Artist% - 2012 - %Album% [FLAC], etc. I wanted to be able to search for /%artist% - $year(%date%) - %album%*/ but it doesn't appear to be possible with what we have available in WSHPanelMod. I ended up creating a glob list and creating entries for each file type like so: "%artist% - $year(%date%) - %album% [FLAC]/*.flac" and "%artist% - $year(%date%) - %album% [dts]/*.dts" etc. Then if I get files returned from in that folder I know the folder exists.

QUOTE (marc2003 @ Nov 3 2012, 05:31) *

How do you use this in WSHPanelMod? Can I just drop that JScript code in? I've never used ActiveX objects before.
Go to the top of the page
+Quote Post
marc2003
post Nov 6 2012, 10:37
Post #1872





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



sure it works. you just need to disable safe mode in the WSH panel mod preferences. i also modded the script a little as it's meant for web pages. see here:

http://dl.dropbox.com/u/22801321/folder%20list.png
Go to the top of the page
+Quote Post
godrick
post Nov 6 2012, 15:13
Post #1873





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



Wow, that's slick. I hereby dump the use of my crude method and will use this instead. Thanks for the suggestion and showing an example, marc2003.
Go to the top of the page
+Quote Post
Gjorgjevski
post Nov 6 2012, 23:56
Post #1874





Group: Members
Posts: 6
Joined: 17-October 12
Member No.: 103913



Does anybody have an answer about this:

QUOTE (Gjorgjevski @ Nov 5 2012, 01:19) *
Any idea why I get an “invalid pointer” error on line 19 ever now and then (it has happened 3 times in 2 and a half months)?


Is it possible that the window global object is invalid in on_paint(graphics)? If yes, what could cause such behavior?
Go to the top of the page
+Quote Post
marc2003
post Nov 7 2012, 10:52
Post #1875





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



step 6 from the notes & hints:

QUOTE
It's better to retrieve window width and height in callback function on_size(), because their values during startup is not reliable.


so i just follow the example that came in the scripts from the component developer....

CODE
var ww = 0, wh = 0;

function on_size() {
    ww = window.Width;
    wh = window.Height;
}


then use ww & wh as you like in on_paint. never had any problems.

This post has been edited by marc2003: Nov 7 2012, 10:54
Go to the top of the page
+Quote Post

120 Pages V  « < 73 74 75 76 77 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th April 2014 - 07:23