View Single Post
  #1488  
Old 01.08.2020, 08:08
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 998
Default

Quote:
Originally Posted by Mydgard View Post
... I used the packagizer ... i would like to have a button in the toolbar to activate/deactivate it ...
Code:
/*
    Toggle packagizer extension
    Trigger: Toolbar Button Pressed
    Customize main toolbar > Add a new 'Eventscripter Trigger' button > Rename it to "Toggle Packagizer" (without quotes, case-sensitive) > Change Icon (optional)
*/

if (name == "Toggle Packagizer") {
    var interfaceName = "org.jdownloader.controlling.packagizer.PackagizerSettings",
        key = "PackagizerEnabled",
        value = callAPI("config", "get", interfaceName, null, key),
        message = "Packagizer " + (value ? "disabled." : "enabled.");

    callAPI("config", "set", interfaceName, null, key, !value) && alert(message);
}
Reply With Quote