Session restoration

I would love if Drafts would restore all of the windows and tabs I had open each time I relaunch the app.

I realize restoring the previous session is not a trivial feature but it would be really helpful for me. I often avoid updating Drafts for a few days because I have to go through the hassle of taking screenshots so I can remember each which workspaces and notes I had open.

(Thanks for adding tab support! I used to use several windows but now that tabs exist I just have one window with a few tabs)

2 Likes

Perhaps much of what you want is achieved in Settings, set “New Draft After” to “never”; at least the settings pertinent to the still-open draft will remain. That may be the single draft answer, incomplete for your needs.

I might also suggest looking at the PIN and Live Activities options – would allow quick retrieval of several drafts, though might take some management to maintain and shift to other actions. read/watch the video: New Drafts and Pinning | Drafts User Guide

I have no experience trying to save other types of notes or ordering workspaces. If you think of this as project issue, a master/main draft could have links to each pertinent draft, and each of them a link back to the main one… Or, a javascript action step could wrap up all your conerns…

Thanks for the suggestions. Do you know how to retrieve the current draft and workspace from each open tab using JavaScript? For now I created a script that opens a hardcoded list of drafts and workspaces.

var draftsToOpen = [
	["DRAFT UUID", "WORKSPACE NAME"],
	["DRAFT UUID", "WORKSPACE NAME"],
	["DRAFT UUID", "WORKSPACE NAME"],
	["DRAFT UUID", "WORKSPACE NAME"]
];

app.hideActionList();

draftsToOpen = draftsToOpen.reverse()

for (const [draft, workspace] of draftsToOpen) {
	app.applyWorkspace(Workspace.find(workspace));

	app.currentWindow.openInNewTab(Draft.find(draft));
}

I don’t recall seeing any functions to do that, across windows or tabs in windows. It would however be a useful addition. People bookmark tabs and set up tab groups in browsers, so doing something similar around Drafts workspaces and set ups might well correlate.

well, I am not a MAC user, ipad mostly, so tabs are not something I use, windows, on the other hand, can give out information as well (probably for tabs, but, not certain. I note v 39 “deprecated” the location of the pertinent javascript options away from straight “app.whatever_the_request” to “app.currentWindow.whatever_the_request”.

“app.currentWindow.getDraftInfo()” presents a box with all the info, but I am uncertain how to extract single bits of info into js. I think you are jiggling the right app. and app.currentWindow movements, but I do not see how to extract the info from the presented boxes. “app.currentWindow.selectedDrafts” gives an array of drafts that have been selected and can be used in sequence, opening windows or otehrwise, but right now I don’t see the hook to select them in your script. So, I am rambling.

One more suggestion – looks as though you are opening each tab/window from your array; can you not extract the necessary info fromn each draft as that progresses?, Workspaces, for instance, can be backwards identified by grabbing the draft.tags array, and searching the workspace.getAll ws array to find the match.

Sorry for no definitive answer.

Isn’t that Drafts in the same action list rather than opened drafts? Being able to work with selected drafts give you a way to batch process drafts as a set.