JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #21  
Old 15.06.2022, 10:17
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

@Jiaz: Glad you think so.

Quote:
Originally Posted by Jdlxber View Post
...toggle button after it changes the mode?
Code:
/*
    Change Shutdown mode
    Trigger: Toolbar button pressed
*/

/*
    Customize toolbar > Create a new "Eventscripter Trigger" button > Rename it to "Close JD" > Change Icon
*/

name == "Close JD" && setMode("CLOSE");

/*
    Customize toolbar > Create a new "Eventscripter Trigger" button > Rename it to "Shutown PC" > Change Icon
*/

name == "Shutdown PC" && setMode("SHUTDOWN");

/*
    Function
*/

function setMode(mode) {
    var storage = "cfg/org.jdownloader.extensions.shutdown.ShutdownExtension",
        interfaceName = "org.jdownloader.extensions.shutdown.ShutdownConfig";

    callAPI("config", "set", interfaceName, storage, "ShutdownMode", mode);
    callAPI("config", "set", interfaceName, storage, "ShutdownActive", true);
    alert("Mode: " + name);
}

Last edited by mgpai; 15.06.2022 at 10:37. Reason: Modified Script
Reply With Quote
  #22  
Old 16.06.2022, 07:12
Jdlxber Jdlxber is offline
Baby Loader
 
Join Date: Aug 2021
Posts: 5
Default

Perfect, thanks again
Reply With Quote
  #23  
Old 16.06.2022, 10:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,044
Default

@mgpai: thanks for your help!
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 20:29.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.