When I switch to a new workspace I would like to load up the most recent draft into the editor.
Any ideas as to how I could do this please?
Many Thanks
When I switch to a new workspace I would like to load up the most recent draft into the editor.
Any ideas as to how I could do this please?
Many Thanks
Flip it round a bit. Create an action to load the draft into the editor and switch the workspace.
Thanks @sylumer I meant load up the latest draft in that workspace (i.e. with the tags that are relevant to that workspace). Does that still apply?
Many thanks
A script to load a workspace, and its first draft would look something like:
// look up workspace
let ws = Workspace.find("MY-WORKSPACE");
// query its inbox drafts
let wsDrafts = ws.query("inbox");
// if more than one, load first draft in editor
if (wsDrafts.length > 0) {
editor.load(wsDrafts[0]);
}
// apply the workspace
app.applyWorkspace(ws);
This is perfect thanks so much!
Typo in the comment above. It should be if one or more, or if more than zero, not if more than one.
@nickwild , this is exactly the sort of approach I was suggesting. You could also consider expanding it.
Thanks @sylumer for this.
Quite agree. I actually incorporated this into an action that allows the user to select from a list of existing workspaces and it brings up the most recent draft and it works perfectly
Great other ideas too!
Made an account just to say this is legendary — for a workflow trying to get to Inbox Zero without added mouse movement, especially. Thank you!