How to change Drafts default file extension to .md?

I have set Drafts default editor to markdown but when I select Save As in the actions menu, it adds .txt as the extension. How can I change the default to .md?

Sorry, I can’t help with an answer (I’m i*OS only), but it may be worth posting this in the Drafts Discourse forum as well. Agiletortoise, the developer of Drafts, is very active in that forum if others can’t help first.

Drafts forum

Hope this helps.

Thanks, great idea!

1 Like

@anon41602260 I realize that I can change the file extension for each export but I was hoping to change the default behavior to be .md. Is that not possible?

Have you tried this Drafts action for Obsidian?

Or, if you’re trying to export all, this script works in Drafts (I cannot remember where I got it from, but it exports all Drafts to the iCloud Drafts folder as .md):

let fmCloud = FileManager.createCloud();
let yourFolder = 'backups';
fmCloud.createDirectory(yourFolder, "/");

let draftsGroup = Draft.query('', 'all');
draftsGroup.forEach(function(myDraft) {
    fmCloud.writeString(myDraft.processTemplate('[[safe_title]]') + '.md', myDraft.content);

After modifying the vaultName variable it worked perfectly! Thanks a million!

I did but I could not find a way to get Drafts to default to the .md extension even when using the markdown keyboard.

Because there is no way to do what you want. There is no default preference that affects all actions. That’s what I was trying to communicate above.

I understand. The good news is that the action recommended by @Rob_Polding does exactly what I needed. :slight_smile:

As always, thanks for the input; you are always a wealth of good information and kind help!

1 Like