p2 / quicklook-csv

A QuickLook plugin for CSV files
Other
289 stars 22 forks source link

ALE file extension #17

Open llamafilm opened 9 years ago

llamafilm commented 9 years ago

Would you be willing to add support for files with an ALE extension? This is Avid Log Exchange — simple tab delimited text files with a few header lines, common in the film industry. Here is an example: https://dl.dropboxusercontent.com/u/33335399/A002R6OW_AVID.ale

Or is it possible for me to add this function myself? I tried editing the Info.plist, but I don't really know what I'm doing here.

p2 commented 9 years ago

Can you execute the following command in Terminal.app and let me know the output?

mdls A002R6OW_AVID.ale | grep ContentType
llamafilm commented 9 years ago

kMDItemContentType = "dyn.ah62d4rv4ge80c5df"

p2 commented 9 years ago

It's a dynamic type, even for you who has an app installed that works with these files (I guess). I have to figure out first if we can define unknown file types in the QuickLook plugin and then announce that the plugin can make previews for that. Could be possible but I don't know and I'm a little short on time ATM.

sardisson commented 9 years ago

This can be fixed the pretty much same way I fixed issue #12 (v1.3 will preview the sample file in a reasonable fashion if I give the sample file a .tsv extension), except for the fact that there does not appear to be any official UTI defined for Avid Log Exchange. We could use com.avid.avid-log-exchange and have it conform to public.text and public.tab-separated-values-text, but I'm reluctant to "invent" a UTI for an active commercial product.

Oh, actually. In theory, it should be possible to just add ale to the list of extensions both places in Info.plist where the plist defines the extensions for TSV files (the places where both tsv and tab are currently), because ALE essentially is a specific form of TSV. I say "in theory" because it's worked in the past, but for whatever reason, doing that plus the move-the-importer-out-and-back-in dance and resetting the generators isn't working here for me. I'm not sure why it's not working for me, and I haven't thought about UTIs and mapping file extensions and whatnot for a few years, so I'm sure I'm missing something, but I can't figure out what :-P Or it could just be some wonkiness on this ancient system.

@llamafilm, if you want to try editing the generator's Info.plist, then moving the generator to a new location in the Finder, then moving it back to the QuickLook folder it came from, and then running qlmanage -r in Terminal, it might work for you.

(Moral of the story: if an application writes a file with a custom/non-public filename extension, the application vendor needs to make sure the application defines the UTI and sets up the UTI<->extension mapping :-P )

llamafilm commented 8 years ago

I added a line <string>ale</string> in both places and relaunched it as you said, but nothing happens when I try to QL ale files.