Sending pieces of a single Draft to different destinations through Actions

Is this doable:

I would like to keep one note open each day as sort of a mashup between a commonplace journal, a daily activity journal, a log of my billable hours and my to-do list. It would be just like the pad I no longer keep at my desk or the little notebook in my pocket.

Then at the end of the day, I can select parts of the daily note to send to different destinations through actions.

    1. Knowledge and ideas got to Evernote
    1. Billable hours goes to a GSheet
    1. Reminders goes to Reminders app

Is it possible to create actions that act on selected areas of notes rather than entire notes?

I’ve used Drafts for quite a while but am still low on the learning curve.

It is definitely possible if you create some custom actions using JavaScript. I’ve modified some Omnifocus tasks that Rosemary Orchard created to work off of selected text instead of an entire draft. If you’re interested in pursuing that as an option, let me know and I’ll share some sample code to help get you started.

Blockquote
let me know and I’ll share some sample code to help get you started.

Sure but my knowledge of JavaScript is minimal to nonexistent. I have managed to edit a few Actions, so if it just a matter of changing the target and if I have examples, I may be able to.

Added:
I just find myself creating too many drafts in a day and wind up with the equivalent of a bunch of notes on my desk.

The key is typically to have some sort of notation that the action can then pick use to pick out which line (or set of lines) should go to which destination. The action can then examine each line/section, and process the content to apply the correct action.

Now depending upon the details of each action, the lines may also need to be structured in a certain way.

Let’s take reminders as an example.

  1. Do your reminders always/sometimes/never have a reminder time/location associated with them?
  2. Do they ever need a priority, etc.

If it is anything but a basic add an entry to a reminder then either there needs to be a structure to the line of information that the action can then interpret, or you need a much more sophisticated action to apply some logic to “figure-out” what you meant by what you entered.

Maybe you could share a sanitised (i.e. modified for public sharing) example of a daily note, and then describe what you would like the action to do in more detail?

1 Like

Agree @sylumer on using/creating structure.

I’d use some heading level (4?) to demarcate sections - and give them standard names.

And/or use Taskpaper format - starting with a dash - for tasks.

OK, here is a copy of a sanitized note… three different actions on sections of one note needed.

Top section: send to my todo app or Reminders in MacOS

Middle section: billable hours. I have an action that embeds a tag and files it in a specific folder in Evernote

Bottom section: an article and a tutorial I save and want tofile in a folder in Evernote called Reference

{ } pick up finished prints at printer
{ } get milk at grocer at 3 pm
{ } create PDF from Acme analysis and send to client


Beta Corp: analysis of recent purchases. 2 hr billable time


Tutorial on photoshop instant mask blending
youtube dot com/watch?v=1jISfd4Oi5w&feature=emb_logo

Investment advice on bonds
January 2021 Kiplingers Jeff Kostnett

Can you put your content between triple back ticks so we can see the exact content? The forum software will interpret Markdown and I’m guessing you probably have some sort of dashed lines to separate your sections.

It might be worth having a look at an Action Group in the Draft Directory called Quick Journaling.

1 Like

Please note that the processing action from from the Quick Journalling action group has some limitations of applicability for this particular case. That is purely because it is a particular solution to someone else’s requirements, but there’s actually not that much overlap to the example above.

The points that I would note are:

  1. The processing action does not have anything for working with Reminders (or whatever as yet undisclosed “my todo app”) or Evernote (Google Sheets seems to have disappeared as a requirement).
  2. The processing action deals with line markers. It doe not deal with a daily note structure based on sections.
  3. The processing action does not take into account any multiline inputs, only single line inputs.
  4. The only parsing of content occurs when it is a Fantastical entry, and it is Fantastical that is doing the parsing, not the processing action.

However, if @snsokstan1 is willing to change the entire approach to creating the daily note draft to align to the different structure, then the processing action could be used as the basis for processing the content of the draft. But determining the type of line entry isn’t the hardest part. Figuring out the processing for each line is much trickier, and because the action doesn’t cover any of the apps required (unless the mysterious “my todo app” is one of the ones catered for), it isn’t going to provide any insights there.

Greg’s Reminder with Options action has some Reminders parsing in it and would probably be a useful resource for figuring out how to process reminders.

There are also lots of actions that deal with Evernote in various ways that could be the basis of working with those two sections. However, Evernote also has issues in regards to URL schemes, and support for AppleScript, so using Drafts’ standard Evernote action step is probably the only way to go; but it does support notebook and tags, and we can have multiple steps to create multiple notes.

@sylumer Thanks. I will look at these suggestions. My todo app is GoodTask (iOS and MacOS), which is just an interface to iOS Reminders, so going to Reminders if fine.

With either templates or keyboard macros in Alfred, structuring a note to facilitate processing should be easy.

I presume I can run two or more actions on the same note, with the last one archiving the note when done.

Exact content of the note above now contained in back ticks follows. Must be a reason for bolding “get” “from” that I am not familiar with.


{ } get milk at grocer at 3 pm
{ } create PDF from Acme analysis and send to client

____

Beta Corp: analysis of recent purchases.  2 hr billable time


____


Tutorial on photoshop instant mask blending
https://www.youtube.com/watch?v=1jISfd4Oi5w&feature=emb_logo

Investment advice on bonds
January 2021 Kiplingers  Jeff Kostnett```

(In this forum, I feel that I am in a Drafts 201 course without having taken Drafts 101.)

Looked at links above.

“Reminders with Options” is what I need. Ditto Standard Evernote action step. Both Installed and running well.

Any guidance or references on how to create/edit/adapt a processing action based on markers in note structure would be appreciated.

Sorry to be so needy.

Okay, here’s your starter for 10, with some caveats.

  1. I made a change to one of your reminders. { } get milk at grocer at 3 pm became { } get milk from grocer at 3 pm … that way we can split on any “at” and check it for being a valid date/time. The code could absolutely be changed to cater for this (just check each entry in the split rather than just the second one), but as I say, this is a quick starter for you.
  2. Because of all of the Evernote stuff I noted above, I’ve set this to use the Evernote Legacy app which still supports AppleScript. If you are wanting to run this on iOS, you would just need to swap in the Evernote action steps - I’ve gone for the more complicated one to illustrate the approach.
    • The third and fourth action steps have entries in them for note titles and tags that you would probably want to tailor.
  3. The first action step is a template tag that specifies which Reminders List you want to add to. Change this to whatever your destination list name is.
  4. I haven’t added anything in for reminder priority or alarms as there was nothing in the example case for this.
  5. There is an option on the action settings that you can set to automatically archive a draft when it runs successfully.

Overall, with the one caveat on the groceries, this worked fine for me on the example draft content, creating three reminders in the correct list, one with a due time, and two notes in Evernote with the content from the draft.

Hope that helps.

Wow, this is very kind of you. I will install and run with this.

Thanks again.

The one thing that occurs to me is that this is all a bit fragile, format wise. So, for example, when @sylumer suggested that “at” should be a keyword you might as well go the whole way with tasks and code them as Taskpaper - assuming Goodtask can handle that format.

As I said before, I’d structure this with e.g Heading 4 lines - one per section.

I would also suggest a template or an action to hatch a draft from - to make this all easier to comply with.

I wouldn’t necessarily agree with the whole sentiment there. Using “at” as the separator here just fit this example case, and as I noted above my suggestion was for the action to be a starting point. GoodTask does not support Taskpaper as far as I know, but free format entry of content is becoming ever more commonplace, and parsing of that falls to the coding, but generally makes it easier for the user.

The advantages of using a stricter format like Taskpaper is that it is easier to code, easier to debug, more accurately processed, and often shorter for the user to enter. The big disadvantage is the cognitive aspect in that the format has to be remembered. For some people this is trivial. For many more it is not - hence the investment in natural language processing (since the 1950s).

I’m fortunate to be someone who can pick up new structures relatively easily, though I do still find myself pausing to recollect or look up elements I don’t use often. That overall slows down my data entry. I could use a helper (Drafts action, text expansion snippet, etc) to assist me in entering the data, but at that point, why not also create the result?

The popularity of Peter’s Things parser action(s) and his Fantastically Good Reminder and Event parser actions highlight how useful many people find the unstructured approach to entering details for later processing.

I think one thing is for certain. Stan will want to amend and develop the structure and processing over time. Writing full-on, complex parsing algorithms, even on relatively constrained domains like reminders, is a time consuming task (if you do it well). So the question for the user becomes where do you spend your time? Learning a more structured way to enter content that is easier to parse in the code, or writing more extensive and complex code so that you can enter whatever you like and still have it parsed correctly.

1 Like

Ah, the “Toolmaker’s Dilemma”… :slight_smile: