Action

Toggle Shopping Mode

Posted by agiletortoise, Last update almost 2 years ago

Enable or disable “Shopping mode”. This is a convenience script to turn on or off three features at once:

  • Focus mode
  • Link mode
  • The device idle (sleep) timer

My primary use for this “mode” is shopping at the grocery store. I make a task [ ] list in a draft. Enabling focus mode keeps my shopping list active. Enabling link mode keeps accidental taps from entering edit mode and showing the keyboard. Disabling the system idle timer keeps your phone from going to sleep so you don’t have to wake up the phone every time you want to check off another item.

For more details on using this action, read the Working with Lists tip article.

Steps

  • script

    let p = Prompt.create();
    p.title = "Shopping Mode"
    p.message = "Pin current draft, enable link mode, and disable device idle timer to make it easier to check off lists while shopping."
    
    p.addButton("Enable")
    p.addButton("Disable")
    p.isCancellable = true
    
    if (p.show()) {
    	if (p.buttonPressed == "Enable") {
    		app.isIdleDisabled = true
    		editor.focusModeEnabled = true
    		editor.linkModeEnabled = true
    	}
    	else { // disable
    		app.isIdleDisabled = false
    		editor.focusModeEnabled = false
    		editor.linkModeEnabled = false
    	}
    }

Options

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