Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: This script will not run (Read 552 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

This script will not run

// ==PREPROCESSOR==
// @name "Display Time and Date"
// ==/PREPROCESSOR==

// Create panel
var panel = new ActiveXObject("Panel");

function on_metadb_changed() {
    // Triggered when song information changes
    update_display();
}

function on_playback_new_track(metadb) {
    // Triggered when a new track starts playing
    update_display();
}

function update_display() {
    // Get the current time and date
    var now = new Date();
    var time = now.toLocaleTimeString();
    var date = now.toLocaleDateString();

    // Display time and date in the panel
    panel.Text = "Time: " + time + "\nDate: " + date;
}

This script does not work, can anyone help me? Thank you!