Typescript Misidentified as MPEG File on MacOS
Asked Answered
C

1

16

EDIT: Still haven't found an answer for this. Here's the plist file which shows that the OS is reading .ts files as MPEG video files rather than text files:

EDIT #2: I've tried restarting my computer with SIP off, but am still unable to edit the plist file.

enter image description here

I'm using a number of quick look applications to peek inside files from the Mac finder. This has been working great so far, and I've been able to add nearly every text file type that I work with routinely ... except for Typescript.

I've tried this method and it doesn't work because my system still views .ts files as video files.

The .ts file extension is read as an MPEG-2 video file of some sort. This is not a file type that I really ever anticipate using or working with. Is there a way to manually override the computer's builtin for the .ts filetype, such that it's picked up as javascript, rather than as a video file?

You can see here that Apple is recognizing the .ts file as a video file:

enter image description here

I went deep into the rabbit hole of editing file extensions and found that the system maps file extensions to their types in something called a .plist file inside your System folder, at /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist and I thought that I could edit that file. But it turns out on Big Sur that System volume is read only. I'm sure editing this file would work (I can see what extension I'd have to remove) but I'm not sure it's the best approach.

Does someone have a better way of getting Mac's to recognize typescript files as text/javascript files?

Crasis answered 15/2, 2021 at 5:24 Comment(7)
Did you find a way to get around the issue - i.e. edit the Info.plist file? or any other way to override?Orvilleorwell
No! Looks like Apple has baked into their OS that .ts files are video files... hence preview applications don't work. I'd love to know if anyone has a solution too :/Crasis
Have you tried this : apple.stackexchange.com/a/316840Outdoors
Yes, that's not possible on Big Sur.Crasis
Have you tried csrutil disable ?Outdoors
Yes, again, this file is not editable with Big Sur. Even with csrutil disabled, the file is read only.Crasis
The file termination .ts started being used for video files at least 15 years before TypeScript has been created.Naxos
F
-2

I believe this issue is based on TS being used for video "Transport Stream". Not sure how to fix this but try opening the file in a text editor such as VSCode.

Forestay answered 28/3, 2021 at 20:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.