markoff: Markoff cannot open files in the "Plain Text" format
To be honest, I just find this kind of amusing!
¯_(ツ)_/¯
Any files with the extension .txt are greyed-out in the file chooser, and I got this error using open -a Markoff foo.txt.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (2 by maintainers)
Commits related to this issue
- Open txt files - Using LSItemContentTypes instead of CFBundleTypeOSTypes - Closes #4 — committed to kaishin/markoff by deleted user 8 years ago
I could help take a look at this. As-is if I (for example) try to drag an image while allowing any file, it shows an appropriate warning (unable to parse the file).
To be more fancy you could tweak the
CFBundleDocumentTypesentry to allow other extensions (pretty much any text extension might be acceptable; plain text is valid markdown for the most part).I notice right now the existing entry uses
CFBundleTypeOSTypeswhich is, while not officially deprecated, not all that useful for modern text files, especially in that it’s allowing ???. Types and creators have been deprecated since 10.6 and are no longer even considered on the current deployment target.The “modern” replacement is
LSItemContentTypeswhich uses UTI’s instead of type-creator codes.Then it’s a decision on which UTI’s to support. Using
public.txtshould be almost automatic. There’s still the problem of the markdown engine trying to parse non-markdown, but again, that’s not a bad thing. Most plain text will render just fine. Some of the other system defined UTIs might be candidates, too.John Gruber has even indicated a preferred UTI for Markdown (UTIs aren’t limited to Apple’s system UTIs).
So there’s good support for arguing
public.plain-textin addition topublic.txtthat I mentioned.