Attached script template: Named Markdown with clipboard

Want to create Markdown notes with the ease of the “New with clipboard” function? - Enter the attached script template “Named Markdown.templatescriptd”.

Not sure if this is the right place for script templates to share, but the script does the following:

  • It asks you for a title for your markdown note (using the first line of the clipboard as a suggestion),
  • creates the Markdown record from a template file with the choosen title and
  • adds the clipboard optionally into the record.

The markdown template “Document.md” is in the resource location of the script template for anybody to adapt to their needs.

Credits: The script is forked from the sample template scripts coming with the DTPro.
NamedMarkdown.zip (9.96 KB)

Hi there,

Thanks so much for this. I’m quite sure it’s me doing something incorrectly but I’ve downloaded and installed the template you provided and get the following message each time I attempt to activate the template:

An error occured when adding the note. Resource not found. (-192)

I am running 2.9.12.

Thanks in advance for any help you could provide as to my error.

Ups, it must be an issue with the refrence to the icon resource. Had trouble with it myself.

In the script part, if you get ride of


set dtIcon to...

and


..with icon dtIcon...

in the display dialog it should work.

I will post a version without the icon refrence.

Glad you like Markdown! :smiley:

Here you go. Hope this one works. Let me know.
NamedMarkdown_v0.2.zip (10.1 KB)

This is super useful to me. Thanks!

This script selects and shows the new note it creates. E.g., I cut some text, invoke the script, then it creates a new note and selects it.

Would it be possible for the script to not select the new note? E.g., I am typically working from a long text, cutting excerpts and making new notes. There’s a bit of friction in creating the new note, then re-selecting the long text again to cut out another new note.

Not sure if this is possible with the scripting tools–perhaps all newly created notes are always automatically selected?

Does this mean you create a note from an selected text snippet of an already existing DEVONthink note? - Interesting use case!

I will look into this and check whether a DEVONthink record can be created via Applescript without selecting it in the application.

Yes, exactly! I read my PDF documents and mark them up in Skim. Then I use a script to export the highlights and annotations to a single markdown file. Then I use your script to select chunks of that file to create new files (I’ve found breaking my notes down from 1 document to several smaller documents gets me better “see also” results).

Thanks so much for sharing this it’s saved me so much time.