Hello,
the following code creates a document test.md, which is shown with the wrong icon but with a type “Markdown” and which opens in the configured external Markdown editor. However, the icon is wrong and the content is not displayed in Devonthink. I looked in the Applescript library but there does not seem to be a special type “Markdown” which I can use for creating Markdown documents.
What is the correct way to create a Markdown document via Applescript?
tell application id "com.devon-technologies.thinkpro2"
set theDatabase to inbox -- the global inbox
set theDestination to incoming group of theDatabase
set newDoc to create record with {name:"Note.md", type:unknown, source:"#"} in theDestination
set newPath to the path of newDoc
set newFile to POSIX file newPath as string
tell application "Finder" to open newFile
end tell
Bye,
Oliver