My Mac recognises the .ts extension as MPEG-2 Transport Stream, while I use it more often as TypeScript files. Because of that Quick Look does not show the contents of .ts files.
I found on Stackoverflow that I should be able to assign custom extensions to the text editor, but I'm not sure how.
QLColorCode is a very nice Quick Look plugin which allows you to set syntax highlighting for ANY extension file you want.
1. Install QLColorCode Quick Look plugin
If you have Homebrew, you can install it with:
brew cask install qlcolorcode
Otherwise, you can just copy / paste the QLColorCode.qlgenerator
to your ~/Library/QuickLook/
folder from a release.
2. Add .ts and .tsx syntax highlighting support
mdls -name kMDItemContentType /path/to/any/file.ts
.ts
file, this should be public.mpeg-2-transport-stream
. To do so, just open the file ~/Library/QuickLook/QLColorCode.qlgenerator/Contents/Info.plist
with any text editor (it's not a compiled file) and in the section CFBundleDocumentTypes > Item 0 > LSItemContentTypes
(~ 15th line), add a line like this: <string>public.mpeg-2-transport-stream</string>
You can find more information on how to add language type support to the plugin in the project README.md.
Here is the original post where I found all this useful information.
According this article, there is another solution:
1) Remove filetype definition from: /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist
You need to do that in recovery mode.
215 => {
"UTTypeConformsTo" => "public.movie"
"UTTypeDescription" => "MPEG-2 Transport Stream"
"UTTypeIdentifier" => "public.mpeg-2-transport-stream"
"UTTypeTagSpecification" => {
"public.filename-extension" => [
0 => "ts"
]
}
}
2) Then run
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With