View Single Post
  #1322  
Old 21.04.2020, 11:27
Sokub Sokub is offline
JD Adviser
 
Join Date: Feb 2018
Posts: 107
Default

Dear mgpai,

for quite a while now I am using the script you generously wrote for my use-case. It allows me to play finished AND also partially downloaded files via the context menu.

It works really great! I would not want to miss it anymore. :-)

Now there is one little thing, which would make it even more convenient in my eyes. If this script would not just work on the file itself ... but already on its folder. (So the folder would not have to be opened before playing the file.)

Say dear mgpai ... could you extend the original script and add this feature? Or is this too much of a hassle?

This is the original script:

Code:
// Open finished or partially download file for the selected download link
// Trigger: Downloadlist Contextmenu Button Pressed
// Customize download list context menu > Add a new "Eventscripter Trigger" button > Rename it to "[Script] Open file" (without quotes) > Change Icon (Optional)

if (name == "[Script] Open file") {
    var link = dlSelection.getContextLink();

    if (link) {
        var player = "/videolan/vlc/vlc"; // <- Set path to media player
        var file = getPath(link.getDownloadPath());

        if (file.exists()) {
            callAsync(null, player, file);
        } else {
            var partFile = getPath(file + ".part");

            if (partFile.exists()) {
                callAsync(null, player, partFile);
            }
        }
    }
}
Reply With Quote