TIP: Creating New Drafts with Templates

Thank you for reply, but I’m stucked. I do not know how to get this going from my iphone 8.
Where can I find the action directory on my phone, please.
Sorry for this. No wizard, just a satisfied user on iphone and apple watch

1 Like

Visit https://actions.getdrafts.com/ in Safari.

You get an option for it when adding a new action, but it in effect just takes you to this web directory.

BUT, if you return to the original post, there’s a direct link to the action in the directory :wink:

TextExpander fill-in snippets cannot be evaluated dynamically. Only as-you-type.

I am using the’New Draft with Templates’ action and it works beautifully. I have just one requirement. Once I have completed the template, I share it to my Day One Journal. In there some way in which this Draft which has now been exported is moved FROM the INBOX to ARCHIVE or TRASH automatically?

The code is actually quite simple; It probably could be modified.

I might be misunderstanding your question, but have you tried changing the “After Success” section of your Share to Day One action? If you scroll down in the edit action menu, you’ll find this section where you can have the draft automatically archived or trashed upon completion of the action.

Hope this helps!

I did what you showed and I think you nailed it. Thanks!

1 Like

Nope. This doesn’t seem to work. The draft remains in the Inbox.

What is it that you are referring to here? The action after success settings that were working for you previously or something else?

The action after success settings

Okay, could it therefore be the actions are failing? What does the log say?

I think there is a delay before the ‘After Success’ action takes effect. Let me check once again. And where can I see the log?

The after success action takes place immediately - no delay.

The log is accessible from the drafts info (“i”). You can then drill into the details. Hopefully the below screenshot helps.

Doesn’t work, screenshot attached.

Well that did work, you can see the log. Looking at the log is intended to help us understand what is going on.

What it is showing is that nothing has been logged for that draft in terms of actions being run.

Check your action settings and ensure it is set to log both successes and failures and to archive/trash as appropriate. Run the action again against the draft and then check the result in the log.

That will tell you the result of running the action.

If it succeeded, check your draft folders. E.g. If the action is set to archive, check your draft is no longer listed in inbox, but that it is listed in archive

Thank you , your solution worked. But it seems I need Pro version to use the function
Before I step into that I like to read/see more examples. Can you help me with that please
I’m thinking of creating fitness logs, containg (automatic entered) date/time and location and(manually added) info field for special things on that trip. Most ideal would be a sequence number added with each new note too. Is something like that possible ??

TIA

Where do I do this?

Check your action settings and ensure it is set to log both successes and failures and to archive/trash as appropriate. Run the action again against the draft and then check the result in the log.

This should appear on the action settings next to the one where you set on the after success action.

You do not need a Pro subscription to use the action directory. Pro subscription is required to modify the steps of actions or create new actions.

Remember that if you want to just try the Pro subscription, there is a 7 day free trial, and if you just need it every once in a while, it is just two dollars (US; slight variations the world over … such as here in the UK for me) for a month’s access, and after that your actions will continue to work. You just wouldn’t be able to amend them without getting another month, or more, of Pro subscription.

The action directory should give you access to many examples. This forum has many more.

You can also read up on the documentation to get a view of the potential as well. This includes some video overviews. If you search online you can find various reviews such as the one at MacStories by @nahumck that will also give you some practical examples to work through, as well as a string grounding in the use of Drafts.

If you need help with specific actions, you can always post a new topic on this forum an people will always pitch in to help you revise what you have and/or advise on approaches, next steps, etc.

Absolutely. Drafts Template (Tags) can be useful for dates and things like the prompt and insert text actions probably would cover the other bits.

Hope that helps.

I wanted to give my templates human-friendly titles, regardless of a template’s contents. I replaced this line:

d.content = d.processTemplate(template.content);

with:

let lines = template.content.split('\n').slice(1);
if (lines[0] == '') {
	lines = lines.slice(1);
}
d.content = d.processTemplate(lines.join('\n'));

Now the first line of each template is its title. The snippet above removes that title from the body (and the second line, too, if empty) before processing it. For example,

Work project

* Item one
* Two
* Three

will show up in the template list like “Work project”, but the new draft will only have the contents:

* Item one
* Two
* Three
3 Likes