View Single Post
  #1534  
Old 09.09.2020, 14:39
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Requested by @RedNapalm (IRC)

Code:
/*
    Append download folder to comment
    Trigger: Downloadlist Contextmenu button pressed
    Customize context menu > Add new "Eventscript Trigger" button > Rename it to "Append folder to comment" (without quotes) > Change Icon (optional))
*/

if (name == "Append folder to comment") {
    dlSelection.getLinks().forEach(function(link) {

        if (link.finished) {
            var comment = link.comment || "",
                folder = link.package.getDownloadFolder();

            if (comment.indexOf(folder) == -1) {
                link.comment = comment + folder;
            }
        }

    })
}
Reply With Quote