Action

Cycle through workspaces

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

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.