Drafts 29 Released - Autocomplete, Shortcuts for Mac support

Drafts 29.0 has been released:

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


What’s New

Shortcuts for Mac / macOS 12 Support

Drafts provides a wide variety of actions for use in Apple’s automation app, Shortcuts. These can be used for simple things like creating a new draft, opening Drafts directly to specific workspaces – or advanced processing by querying and updating multiple drafts.

r29-4

With macOS 12, Apple has brought the power of Shortcuts to the Mac, and Drafts is ready. All Drafts’ Shortcuts actions now work on both iOS and Mac, and shortcuts created using these actions work cross-platform, allowing you to create, modify, and use those shortcuts on all your devices!

Autocomplete

Drafts now includes an extensible system to provide drop-down autocomplete suggestions while typing in the editor. Autocomplete includes a global system for creating and inserting text snippets. Additional autocomplete suggestions can also be provided by syntax definitions.

Global Autcomplete Suggestions

Do you have snippets of text you reuse regularly? Email addresses? Templates? Then autocomplete suggestions will be a handy addition.

r29-3

Visit the Autocomplete tab in Editor Preferences (Aa button below editor) to get started configuring your suggestion drop-down items. Set the “Trigger” text to control what sequence of characters will trigger the suggestion drop-down to appear, and add items for frequently used snippets. Suggestions can use Drafts template tags to insert the current date, location, or other values.

Link Completion and Draft Insertion

Drafts built-in Markdown syntaxes (Markdown, GitHub Markdown, and MultiMarkdown) now include two additional autocompletion features to work with other drafts in your library:

  • Type [[ to trigger auto-completion of [[wiki-style]] links to other drafts by title.
  • Type << to trigger the selection of another draft and insert the full content of that draft.

r29-2

These features are implemented using a new set of configuration options available to all syntax definitions. If you create custom syntax definitions, and would like to add this functionality (or similar) to your custom syntax definitions, take a look at the related documentation on autocomplete in syntaxes

Learn more about Autocomplete

Other Updates and Fixes

All Platforms

  • Fix: A numbered list item with more than one digit, indented 4 characters, would be treated as code block in Markdown syntaxes.
  • Fix: /open URL with title param would not properly find drafts with “:” in the title parameter.

iOS

  • Fix: “Last Draft” option available with long press on app icon would not work properly on iOS 15 if the app was already running and the new draft timeout had passed.
  • Configuration tweak to allow the “Add Link” option to work to create links to the current draft in Quick Notes.
11 Likes

Another strong release! Thank you so much for all your hard work on this great app.

1 Like

Autocomplete is doesn’t work by Chinese

Autocomplete is triggered by [[. Are you typing those characters? They are not the default characters for the bracket keys on many Chinese keyboards.

Autocomplete is brilliant - thanks

2 Likes

Since iOS 15 has been released, there is a problem in the sharing function. I use Anki, the learning app. Earlier I could just invoke the share select after selecting the text and the selected text used to automatically appear in the Drafts sharing window. Now, I have to copy and paste it, so one more step, first highlight then copy and then paste.
Secondly, if open a link in safari and invoke the share sheet, sometimes the link appears automatically, sometimes it does after I refresh the page, its random, I wonder why.
To conclude there is definitely something strange about the share sheet behaviour., Could you enlighten me on this?

I understand what you are saying.
But that’s not my problem. I uploaded a GIF of the problem reproduction, you can check it out

I set the theme to ‘Six Colours’ and I want that to be the default theme. It doesn’t stick, why is that? I can’t find the setting to make it default

Are these the steps you have been following?

Yes, I make the theme active. But, it doesn’t stick

I believe there’s a difference between making a theme active and making it the default.

How does one make it ‘default’, I can’t find the setting.

You set the active theme for light/dark mode for the app. Then you specify your app’s mode as light, dark or system (determined) and one of the two active themes would be applied.

Workspaces also have overrides to themes based on the light/dark mode, if you opt to specify them for a particular workspace.

I think in all cases they are referred to as the active theme.

Syntax specifically has an option to set a default.

Aha. My mistake. Thanks

There is no app wise setting of this sort. At least, I couldn’t find it. The problem is that you select ‘system’ inside the app AA setting. The dark one sticks, the light one doesn’t.

As per the IOS docs, in the editor settings you should see something like this.

You set the themes you want to have active in the different modes in the theme selection settings. I.e., you set the theme you want active in light mode AND you set the theme you want active in dark mode.

You set the mode you wish to use in the active theme settings. I.e., do you want to apply light mode OR dark mode OR follow the system-wide setting?

Yes, got all this and its done as well. If I select ‘Dark’, no issues. Once I select the ‘Light’ theme it does get applied. If I close the app and restart the app again, the dark theme sticks, the light one doesn’t. It doesn’t matter if I have selected, dark, light or system, the Light theme doesn’t stick.

Where exactly are you selecting? That statement is not specific enough to define what you are doing.

Do you mean you are selecting “Light” in the Active Theme settings? If so, that should immediately apply the theme you have specified to be used for the ‘light mode’.

If you mean you are specifying it in Theme Selection, that would not necessarily apply the theme to be displayed. It specifies what should be displayed when you change it in the Active Theme. If you are set in Active Theme to use the light theme, and you change the light theme in Theme Selection, the theme should be applied immediately.

Based on this, can you get a change in light theme to be applied?

Just to clarify, are you force closing all instances of Drafts, or are you just switching back and forth between apps? I ask because the latter is what most people consider as closing an app (it isn’t), and the former should only be done in the case of an issue, so I understand why you might be trying this once or twice, but it should only be required as an exception to test something.

I press AA and then the Editor window pops up. I select Light and it gets applied.

I am force closing the app, I don’t keep too many open, I think it affects battery performance. As a matter of habit, I force close all apps when I plug in the charger, not otherwise, too many open apps almost definitely slows down the time taken to charge the iPad. And iPad is the main device for me.

Same topic raised by another user here

I don’t think this is specifically related to the theme problem you are having, but you should 100% not force quit apps. It has a lot of bad side effects. Every app you force quit gets background refresh disabled until the next time you reboot, so, for example, Drafts is not able to keep sync updated in the background, not able to push out updates to your Watch if you have one, etc.

Any, yes, in some cases it can cause data loss if the app has not been able to finish processing operations to save/update data when you force quit.

So, yea, don’t do that. It is not impossible that you have corrupt preference files as a result of force quitting. I might suggest the next thing to try to fix the theme issue is to delete and reinstall and see if that has any effect.

1 Like