Action

Cycle Workspace FWD

Posted by @nahumck, Last update over 2 years ago - Unlisted

Original idea from the Drafts Forum. Credit to @jsamlarose for creating the original action!

Steps

  • script

    workspaces = Workspace.getAll()
    
    // get index of object by property (https://stackoverflow.com/a/39529049)
    var index = workspaces.findIndex(item => item.name === app.currentWorkspace.name)
    
    if (index == -1 || index == workspaces.length-1){
    	var workspace = Workspace.find(workspaces[0].name)
    } else {
    	index++
    	var workspace = Workspace.find(workspaces[index].name)
    }
    
    app.applyWorkspace(workspace)
    app.showDraftList()
    // app.displayInfoMessage(workspace.name)
    // alert(workspace.name + "," + index)
    

Options

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