marc2003, just one question.
Is it possible to replace something in your Web Links script for one of the buttons to execute Run Service (foo_run) whenever clicked? I've tried using var viewer = fb.RunContextCommand("Run service/Open Novel"); -- which opens calibre program in my case -- but does not work as planned. Whenever the title is playing, it executes Run Service on its own, and multiple times, without me actually clicking the button.
Here's how the whole script currently looks like. I don't really have much experience with scripting, if at all, save for changing some small things, like different sites in example below, so would really appreciate some help.
// ==PREPROCESSOR==
// @import "%fb2k_profile_path%marc2003\common6.js"
// @name "Web Links"
// @author "marc2003, Images by komodomedia.com and mjm716"
// @version "6.2012-12-05.01"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==
var p = new panel("Web Links", ["custom_background", "metadb"]);
var b = new buttons();
b.update = function() {
if (!p.metadb) return;
var artist = encodeURIComponent(p.eval("%artist%"));
var title = encodeURIComponent(p.eval("%title%"));
var album = encodeURIComponent(p.eval("%album%"));
var fantasticfiction = "http://www.fantasticfiction.co.uk/search/?searchfor=book&keywords=" + album;
var goodreads = "https://www.goodreads.com/search?utf8=%E2%9C%93&query=" + album;
var wwe = "https://www.worldswithoutend.com/searchwwe.asp?st=" + album;
var wikipedia = "http://en.wikipedia.org/w/index.php?search=" + album;
var viewer = fb.RunContextCommand("Run service/Open Novel");
b.buttons = {
but1: new button(12, 5, 32, 32, {normal: "ff1.png", hover: "ff1_h.png"}, function() { p.browser(fantasticfiction); }, fantasticfiction),
but2: new button(54, 5, 32, 32, {normal: "goodreads2.png", hover: "goodreads2_h.png"}, function() { p.browser(goodreads); }, goodreads),
but3: new button(96, 5, 64, 32, {normal: "wwe2.png", hover: "wwe2_h.png"}, function() { p.browser(wwe); }, wwe),
but4: new button(170, 5, 32, 32, {normal: "wiki.png", hover: "wiki_h.png"}, function() { p.browser(wikipedia); }, wikipedia),
but5: new button(212, 5, 32, 32, {normal: "viewer.png", hover: "viewer_h.png"}, function() { p.browser(viewer); }, viewer)
}
window.Repaint();
}
on_item_focus_change();
function on_size() {
p.size();
}
function on_paint(gr) {
p.draw_background(gr);
b.draw(gr);
}
function on_metadb_changed() {
b.update();
}
function on_mouse_move(x, y) {
b.move(x, y);
}
function on_mouse_lbtn_up(x, y) {
b.lbtn_up(x, y);
}
function on_mouse_rbtn_up(x, y) {
p.rbtn_up(x, y);
return true;
}