Action

Shopping Mode (for iOS Widget)

Posted by Chris Grieser, Last update over 3 years ago

A modified version of Toggle Shopping Mode for use in the iOS Grid Widget.

In addition to the original, it also opens a specific workspace and a specific Draft when enabling Shopping Mode (e.g. the shopping workspace and a specific shopping-list-draft). When disabling, it also returns to the home screen.

Needs this Shortcut installed on your phone, its sole purpose is toreturn to the home screen after disabling.

Furthermore, you need to change the script and insert the workspace and draft you which to open upon enabling.

Steps

  • script

    let p = Prompt.create();
    p.title = "Shopping Mode";
    p.message = "Toggle focus & link mode and device idle timer to make it easier to check off lists while shopping";
    
    p.addButton("Enable");
    p.addButton("Disable");
    p.isCancellable = false;
    
    p.show();
    if (p.buttonPressed == "Enable") {
    	app.isIdleDisabled = true;
    	editor.focusModeEnabled = true;
    	editor.linkModeEnabled = true;
    }
    else {
    	app.isIdleDisabled = false;
    	editor.focusModeEnabled = false;
    	editor.linkModeEnabled = false;
    }
    
    if (p.buttonPressed == "Enable") {
    	let workspace = Workspace.find("Tasklists"); //edit workspace here
    	app.applyWorkspace(workspace);
    	// select which draft to open, e.g. be replacing "Supermarkt" with the respective draft title
    	theLastModifiedDraft = Draft.query("Supermarkt", "inbox", ["tasklist"], [], "modified", false, true);
    	editor.load (theLastModifiedDraft[0]);
    } else {
    	app.openURL ("shortcuts://run-shortcut?name=Go%20back%20to%20Home%20Screen");
    }
    
    
    
    

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.