Prepend Timestamp to Multiple Drafts and Merge

I am using the shortcut action “Create Draft with Dictation” to create multiple drafts during the day detailing what I just accomplished and what is next on the plate.

At the end of the day, I have a workspace which contains all these drafts, each generally just a few lines in length. My goal is to create an action which processes these drafts, prepending the timestamp on each one, then merging all the drafts in the workspace into one.

For Example:

Draft 1 (Created 08:03)
Got Coffee and triaged mail while waiting for coffee to cool.

Draft 2 (Created 08:37)
Call with key partner, just put entire day into shredder. Rest of day will be updating redlines on proposal.

The goal is to turn that into a single draft looking like:

  • 08:03: Got Coffee and triaged mail while waiting for coffee to cool.
  • 08:37: Call with key partner, just put entire day into shredder. Rest of day will be updating redlines on proposal.

I’ve done some script modifications within an editor space but never across multiple drafts. Can anyone point me to any good examples to start from?

2 Likes

if your drafts are all in the same workspace then I think the Workspace.query API is what you need to get those drafts: Workspace | Drafts Script Reference

Actually a nice use case after thinking about it and a great usage of drafts.
This is what I came up with:

let me know if it fits your needs

2 Likes

Looks like almost exactly what I was thinking of. Just installed it and will play with it over the next few days. Give you an update this weekend. Thanks!

1 Like

Hi @Denrael, did you ever get your workflow setup how you want it?

1 Like