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: 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

I wish it could be done without having to use a workspace for the selection, is there any other way of passing the selection?
I guess my requirement is slightly different, I would like to retain some of the metadata (in plain text) on merge (creation timestamp and location).

You could build a different selection approach and plug that in.

In fact, you should take a look at this action group.

It effectively gives you a drop in for doing the selection. You can tailor it to your own needs and wire it in as a replacement for using a workspace; and modify the merging to include the meta data in the desired format.

1 Like