Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On OS X I'd like to change the "Kind" label associated with files. Many of my files are showing up as "Plain Text File" when they are really javascript, php, css, and other file types.

I don't have a problem getting them to open with the application I want, it's easy to do - there are lots of threads on this.

The thing that bugs me is when I have a big folder with lots of files in it, I'd like to be able to sort by Kind and have all css, all php, and all js files together.

enter image description here

I saw file type which crashes on OSX, and I saw quickchange but I'm not sure if that's really what I need.

Maybe somebody else has dealt with this before and knows how to fix it?

share|improve this question
    
Interesting. It does not seem to be related to the veritable command line utility file. –  dmckee Mar 28 '11 at 0:29
    
Surely you can just set something like TextWrangler as the default file handler for JS, PHP and CSS files? Then it'll list them as TextWrangler files. –  user3463 Mar 28 '11 at 3:54
    
I think the problem might have been with coda. Daniel Beck helped solve it below. A follow up question, though: So what is the quickchange utility I found (above) used for? It has something for a 4 letter "type" and a 4 letter "creator"... ? –  cwd Mar 28 '11 at 13:39

3 Answers 3

up vote 5 down vote accepted

The file kind is usually set by the application that handles that file type in Launch Services. For most of them, this is the application opening a file type by default, in your case, Coda.

Applications specify file types in their Contents/Info.plist file. You can see and edit it by right-clicking the application bundle and selecting Show Package Contents.

It looks like the Panic folks messed up something. All file types they define are PlainTextType:

enter image description here

You can change the name of the file type by editing all Document Type Name entries in Property List Editor, or all CFBundleTypeName entries when editing the file in a normal text editor. Just replace what you want to appear as description instead.

enter image description here

Edit, save, and make sure Launch Services notices (restart, log out, or just move the application to a different folder and back again), and the result looks like this:

enter image description here


You need to repeat this whenever there's an update to the application, since those replace the Info.plist file you edited. Best to report a bug to the developers at Panic.

share|improve this answer
    
and the folks at Panic will (probably) report that a .php, .js, or .css file is still a plain text file. its semantics, and that isn't the purpose of UTIs. this isn't a new debate; UTIs have beem misunderstood and misused since their inception, partly because of this very issue, which apple, in their infinite wisdom, has done nothing to address, yet. –  peelman Mar 28 '11 at 6:05
    
@peelman Apple doesn't do it like this in TextEdit's Info.plist. They are actually capable to provide proper Document Type Names. And users care more about Finder's Kind column than the technical aspects of UTIs. –  Daniel Beck Mar 28 '11 at 6:50
    
@db - is PListEdit Pro the same thing as Property List Editor? I have the first and my screen looks a bit different. Thanks for a rather comprehensive answer :) –  cwd Mar 28 '11 at 13:22
    
nm, just found Property List Editor in the /Developer/Applications/Utilities folder. I didn't have QS cataloging that folder. oops. –  cwd Mar 28 '11 at 13:28

Have a look at duti

A command line tool to select default applications for file types, on OS X

share|improve this answer

its up to the saving program to set the UTI (uniform type identifier) for a given file. if you manage to change them, then edit the file in whatever program you created them in that set them as plain text, they will likely be reverted to plain text when you re-save.

technically those files ARE plain text, they can be opened by any editor that supports the plain text UTI, which is the purpose UTIs serve, so this isn't an inaccuracy, its a semantics exercise. i personally avoid such issues by putting my images, stylesheets and javascript files in subfolders.

regardless, you likely need to scour your chosen editor and see if it supports a way to define UTI->file extension relationships, or a way ro define what UTI a file is aaved with.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.