ExtremeHunter
I've been playing around again with your Spinning Disc Image Viewer script, version 2013-08-08, which you pasted online here [pastebin.com] .
I've been editing your script for the past few hours, trying to create a context menu having these three items:
------------------------------
Open folder of this disc
Open folder of this panel
Configure...
-------------------------------
The context menu works except for one problem . . . . . Selecting "Open folder of this disc" opens the "Now Playing" folder and the active track is selected in Windows Explorer.
Unfortunately, this is not what I want . . . . . What I want is to open the folder containing the current spinning disc image and the image is selected in Windows Explorer.
Here is the code I have added to your script:
var WshShell = new ActiveXObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");
MF_GRAYED = 0x00000001;
MF_STRING = 0x00000000;
function on_mouse_rbtn_up(x, y) {
metadb = fb.GetNowPlaying();
var folder_path_disc = metadb ? metadb.Path : "";
var folder_path_panel = fb.ProfilePath + "user-addons\\wsh-spinning-disc-image";
var _menu = window.CreatePopupMenu();
var idx = 0;
_menu.AppendMenuItem(fso.FileExists(folder_path_disc) && metadb ? MF_STRING : MF_GRAYED, 1, "Open folder of this disc");
_menu.AppendMenuSeparator();
_menu.AppendMenuItem(fso.FolderExists(folder_path_panel) && metadb ? MF_STRING : MF_GRAYED, 2, "Open folder of this panel");
_menu.AppendMenuSeparator();
_menu.AppendMenuItem(MF_STRING, 100, "Configure...");
idx = _menu.TrackPopupMenu(x, y);
if (idx == 1) try {
WshShell.Run("explorer /select," + "\"" + folder_path_disc + "\"");
}
catch(e) { }
if (idx == 2) try {
WshShell.Run("explorer /n," + folder_path_panel);
}
catch(e) { }
if (idx == 100) window.ShowConfigure();
_menu.Dispose();
return true;
}
NOTES:
I use foobar2000 in portable mode.
All default resources used for this panel are contained in one folder: "<fb2k_dir>\user-addons\wsh-spinning-disc-image\"
All disc image targets for the script are placed at the same location as the tracks.
ONE MORE QUESTION:
If I was to add one more context menu item named Help, and if this is selected a Message Box pops up with some text,
does anybody have the code for doing this?