I have a workspace containing Drafts marked with a Red Flag. This is my daily work workspace so I would like to be able to open it and then as it opens, go on to open each Draft in the workspace in its own tab.
I do this manually but I would like it automated. I’ve had a look around but can’t come close to finding anything to do it. I’d appreciate any ideas or better, a solution.
// get the workspace
let ws = Workspace.find("My Workspace")
// load the inbox drafts in the workspace
let drafts = ws.drafts("inbox")
// loop over the drafts and open them
for(let d of drafts) {
app.currentWindow.openInNewTab(d)
}
I had a problem with the “let Drafts …” line, but the following works even if it isn’t the most consistent or elegant code ever seen on here
// get the workspace
let ws = Workspace.find("Live")
// load all drafts in the workspace
ws.loadFolder = "all";
app.applyWorkspace(ws)
let drafts = Draft.query("flag:red","all","",false);
// loop over the drafts and open them
for(let d of drafts) {
app.currentWindow.openInNewTab(d)
}