Toggle System Sleep

Posted by agiletortoise, Last update over 1 year ago

Toggle status of system sleep timer. Disabling the timer will prevent the screen from dimming and device going to sleep while using Drafts.


  • script

    let isDisabled = app.isIdleDisabled;
    let p = Prompt.create();
    p.title = "Toggle Sleep Timeout";
    if (isDisabled) {
    	p.message = "Current status: Sleep Disabled\n\nSystem will not dim screen while in Drafts.";
    else {
    	p.message = "Current status: Sleep Enabled\n\nSystem will automatically dim screen and sleep to preserve battery while in Drafts.";
    p.addButton("Disable Sleep");
    p.addButton("Enable Sleep");
    if ( {
    	if (p.buttonPressed == "Disable Sleep") {
    	else {


  • After Success Nothing
    Notification Error
    Log Level None
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.