View Single Post
  #1560  
Old 25.10.2020, 06:54
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,415
Default

Quote:
Originally Posted by Dockel View Post
Is there a way to enable / disable sound notification for more than one link / download and / or a package?
Code:
/*
    Toggle sound notification
    Trigger : Downloadlist Contextmenu Button Pressed AND/OR Linkgrabber Contextmenu Button Pressed
    Customize context menu > Create a new "Eventscripter trigger" button > Rename it to "Toggle sound notification" > Change Icon (optional)
*/    

if (name == "Toggle sound notification") {
    var dlSelection, lgSelection;
    var selection = dlSelection || lgSelection;

    if (selection) {
        var items = selection.linkContext ? selection.links : selection.packages;
        var myComment = selection.packageContext ? "#playsoundwhenpackagefinished#" : "#playsoundwhenlinkfinished#";

        items.forEach(function(item) {
            var comment = item.comment || "";
            
            if (comment.indexOf(myComment) > -1) {
                item.comment = comment.replace(myComment, "");
            } else {
                item.comment = myComment + comment;
            }
        })
    }
}
Quote:
Originally Posted by Dockel View Post
And is there a way to recognize whether sound notification is enabled / disabled for a link?
You can check link/package comment using any of the following to see if notification has been enabled:
  • Enable 'comment' column in list
  • Check comment field link/package properties panel
  • Use the bottom toolbar search field to filter links/packages by comment
Reply With Quote