Drafts 39 released: OpenAI-ChatGPT, Tabbed Windows, Cursor Positioning

Drafts 39.0 has been released:

Details below. For a complete history of updates, visit:


OpenAI - ChatGPT Scripting

There has been a lot of excitement recently about AI, and in particular OpenAI’s ChatGPT. It can be a useful tool for a variety of text transformations and analysis, like translation and summarization. A number of users have already created example actions for Drafts that directly access the OpenAI API, but we wanted to make doing so a bit easier, so we’ve added a new OpenAI scripting interface to take care of some of the heavy lifting of working with these APIs.

If you are interested in ChatGPT-OpenAI integration, how it can be used in Drafts, and getting some example actions, head on over to our new OpenAI-ChatGPT integration guide

More on OpenAI-ChatGPT integration

Tabbed Window Support on macOS

Keyboard Shortcut Note

The default keyboard shortcuts control-tab and shift-control-tab are now assigned to next/previous tab navigation to match Safari and other tab-based apps. These were previously used for next/previous draft. Those commands are now bound to shift-control-up/down arrow.

The Mac version of Drafts now supports macOS’s tabbed window system. You have always been able to open multiple drafts in separate windows, but it is not also possible to do with with tabs in the same window - and drag and drop tabs in and out of the window, etc.

To use, right-click on a draft in the draft list and select “Open in New Tab”, or Select View > Show Tabs in the main menu to always display the window’s tab bar.

Cursor Positioning Options

The editor settings (Aa) pane has two new options to control what happens when a draft is selected from the draft list and loaded in the editor:

  • Focus Editor: If enabled, when a draft is selected, cursor focus will be immediately placed on the editor, ready to start typing. On iOS, this means the virtual keyboard will appear, etc. If disabled, the draft is loaded but still requires a tap-click to focus the editor and begin editing.
  • Place Cursor: This option controls where the newly loaded draft should have the cursor placed at the point of the last edit of that draft (the previous default), or always at the top or bottom of the text.

The right combination of these options depends on your use cases. If you are always opening draft to add more text at the end, you would likely want focus editor enabled, and “bottom” as your cursor position. If you more commonly browse existing content in your drafts library, you may prefer to disable focus editor and not have the editing automatically enabled.

More on Editor Settings

Other Updates and Changes

  • All Platforms
    • Auto-complete suggestions now place items beginning with search value at the top of the list of results. So, typing [[t would always put a draft titled “Test” before a note title “My Test”. Modification date descending is still the secondary sort.
    • Auto-complete now allows backspacing your query down to zero characters before dismissing the drop-down.
    • Add template tag helper popover in auto-complete configuration to make it easier to insert tag values.
    • Display source device in version history.
    • Share and action extension now set the last cursor position of newly created drafts to the end of the content.
    • Trim whitespace from HTML to Markdown conversions to avoid unnecessary line feeds.
  • iOS
    • Auto-complete dissappearing when used in longer drafts.
    • Crasher in lock screen widget configurator generating placeholders.
  • Mac
    • “+” menu buttons at top of draft and action list, similar to ones that already exist in iOS version to allow creation of new drafts and actions.
    • Work to avoid some peculiar, difficult-to-reproduce crashes in Quick Search.
    • Tag suggestions behaved slightly differently in the capture window. Aligned behavior with main window.
    • Add shift-command-A keyboard shortcut to toggle between inbox/archive destination in the capture window.
  • Scripting
    • OpenAI script object. See above, or docs for details.
    • app.currentWindow.canOpenTab True on Mac, false on iOS.
    • app.currentWindow.openInNewTab(draft) function. Returns boolean for whether tab was opened successfully.
    • Deprecations: The below properties and functions have been moved to the Window object from the App object. All will continue to work as-is, but the preferred use is now app.currentWindow.- instead of app.- More details in docs
      • isDraftListVisible
      • showDraftList()
      • hideDraftList()
      • showQuickSearch(initialQuery)
      • showDraftInfo(draft)
      • isActionListVisible
      • showActionList()
      • hideActionList()
      • loadActionGroup(group)
      • loadActionBarGroup(group)

Drafts 39 broke one of my keyboard shortcuts. I have Control-Option-D set to show Drafts main window. Now, Control-Option-D is showing/hiding the tab bar instead. Setting the same keyboard shortcut in Drafts-Settings does not seem to be able to overwrite the showing/hiding of tab bar. Any ideas how I can change this behaviour? I hate to have to assign new shortcut to show/hide main window.

I can’t reproduce that here. There’s no shortcut attached to the “Show Tabs” command in the view menu. control-option-D does nothing in my install.

The funny thing is, if I don’t have tabbed window i.e. I did not right click on a draft and “open in new tab”, my control-option-D works as usual. Once I have a draft in a tab, control-option-D will hide the tab. Pressing control-option-D again does nothing after that.

The link to “More on Editor Settings” needs to start “docs” not “doc”