Drafts 5.2 Released

Drafts 5.2 is now available in the App Store. Navigation of longer drafts, the ability to assign tags as part of an action’s “after success” settings, improved Watch sync and more. Details:

New in 5.2

  • Actions now have an “Assign tags” after success setting. In addition to moving a draft to the archive or trash, after success can now also assign tags - great for marking or filing away drafts automatically when processing them. For example, set the Tweet action to automatically assign the “tweet” tag when run on a draft and you can later easily filter for tweets. Details
  • In-draft navigation to jump between key marks in longer drafts. Accessed via the navigate button (down arrow icon) in the upper right (or ⌘-\ shortcut). Currently navigation supports jumping to headers in a Markdown draft, projects in a Taskpaper draft, and functions and “// #region Name” region comments in Javascript drafts. Details
  • Scripting additions to support switching workspaces and action groups:
    • Allows for action setup to load a workspace, and simultaneously switch selected action list and keyboard row.
    • Inquiry about and toggle visibility of drafts and action lists:
      • app.isDraftListVisible, app.showDraftList(), app.hideDraftList()
      • app.isActionListVisible, app.showActionList(), app.hideActionList()
    • Load action groups and apply workspaces in script:
      • app.loadActionGroup(group), app.loadKeyboardActionGroup(group)
      • app.applyWorkspace(workspace)
    • Also Workspace and ActionGroup objects to allow lookup of groups and workspaces.
    • More details on scripting reference site
  • Additional URL Actions
    • /loadActionGroup?name=GROUP-NAME - loads action group in action list
    • /loadKeyboardActionGroup?name=GROUP-NAME - loads action group in extended keyboard.
    • Details in URL scheme documentation
  • "List in Reminders" action step now has a template. Useful to create one for sending only [[selection]] or passing in values from script or prompt. Details

Other Fixes and Changes in 5.2

  • Fix (Watch): Improvements to communication between Watch and Phone to address some issues with stuck transfers.
  • Fix (Watch): Watch app auto-capture from complication did not work if app was already running and open to a view other than the main capture view.
  • Fix: Some tweaks to Taskpaper syntax.
  • Change: Do not dismiss any presented views when the new draft creation timeout is fired to avoid loosing unsaved work in actions, etc.
  • Fix: Moving through action list with up-down arrow keys should scroll items into view when necessary.
  • Fix: URL action step should ignore “Open in Drafts” option if the URL generated is a non-http(s) URL.
  • Fix: Opening current list options without making changes could result it “current list options” erroneously displayed in list filter.
  • Fix: “Insert text” action step now plays nicer with other subsequent action steps.
  • Fix: Address a case where sync could get stalled in odd timing situations where sync was requested more than once quickly.
  • Fix: [[draft_open_url]] tag was not working.
  • Change: Work on some general improvements to syntax highlighting to avoid a few glitches in rendering.
  • Change: Several improvements to Markdown syntax, including highlighting of horizontal rules and indented code blocks.
  • New: Add keyboard shortcut preview when managing action groups actions.
  • Change: Some under-the-hood improvements to Action Directory sharing to support additional features on the web site.
4 Likes

Love this update, in-draft navigation is so great!

Might I add a request for future support of MMD metadata variables (foo: bar) in syntax highlighting? Lighting or darkening text color like list delimiters, for example.

1 Like

I was playing with the new Workspace support in javascript and I feel it could go much further. For example, I wanted to simulate a query in javascript that returned the drafts in a workspace.

You may already be aware, but there is a query function for draft objects that can be used to fulfil this. Is it just want the convenience of a shortcut to returning the same set of drafts within one of the workspace’s tabs? If so would it be more appropriate to retrieve an array of tags and the tag filter mode, and then re-use the existing query function? You could then use that to say build up queries dynamically based on multiple workspaces.

Admittedly that might reduce immediate convenience (you could code something generic based on a single workspace and reuse that) but it would add more flexibility.

I’m aware of query() and use it. Having read the docs many times - from github - I don’t see how to restrict a query to a particular workspace.

I also don’t see how to get the current workspace name nor how to set the current workspace - from javascript.

On all these I might be missing something and they’re really there. Happy to be wrong. :slight_smile:

My original point was that you know or can see what the query or queries are that the workspace is applying. You can see it in the UI - not programmatically, which was my subsequent point.

If you know what the queries are, you can use query() to do the same; you just have to manually build the parameters and potentially combine sets of drafts. Maybe even deduplicate too depending upon result set overlaps.

The app object allows you to set a workspace:

app.applyWorkspace(Workspace.find("My Workspace Name"));

I don’t see any option listed to query the app object for the current workspace, but I think that would be a reasonable thing to submit as a feature request. After all if you can set it, why not also be able to get it?

OK. So I opened a pair of feature requests:

Between them they should make this whole area more usable, particularly from the javascript perspective.

Actually, I hope I’m not a prescriptive kind of fellow and @agiletortoise might come up with some other way of moving this forward.

1 Like