Jump to content
TheDonk

Markdown file filter

Recommended Posts

I make a file filter, set a scope and drag a .md file into the file type part of the basic setup. But it doesn't find any markdown files. However, if I change the extension to .markdown it works. It also works to change the extension to mdtxt or mdown

 

Just to be sure, I added a different filetype .taskpaper to check that I didn't bungle something easy - and that showed up just fine.

 

It gets the name "net.ia.markdown" in the File Types. I tried a cheeky adding of an object called "net.ia.md" to no avail.

 

Now I could rename all my markdown files from .md to .markdown, but I don't want to.

Share this post


Link to post

Probably a Launch Services issue. 

 

Your system doesn’t (properly) recognise .md as a Markdown extension.

 

Run mdls or Andrew’s metadata tool on a few .md file to see what the system thinks their UTI is.

 

The solution is to ensure that some application is registering .md with the correct UTI. You can create a do-nothing application with Xcode with the corresponding entries in info.plist.

Share this post


Link to post

Cheers guys, mdls was a great tip. Gave me "com.unknown.md", which if added picks up .md files.

 

It still says it's a markdown file though, kMDItemKind = "Markdown". Doesn't matter much anyways, now that it works.

 



GswZReN.png

Share this post


Link to post
1 minute ago, TheDonk said:

It still says it's a markdown file though, kMDItemKind = "Markdown". Doesn't matter much anyways, now that it works.

 

Your system does know about Markdown, then.

 

No idea where the com.unknown.markdown UTI has come from, but unless something has changed in High Sierra, macOS gives actually unknown types UTIs like dyn.ABCXYZ

 

If it matters, you can dump the Launch Services database to see what registered that UTI.

Share this post


Link to post

Thanks, but not that important for me now that I can search my notes-folder with a hotkey.

 

Good to know as a reference point if I have similar issues in the future though

Edited by TheDonk

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...