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.

I edit lots of .sass, .scss, html.twig files. And so I wanted to associate these with Sublime Text 2. Because by default some of them get the "binary"-icon, some the "blank sheet"-icon which sucks in terms of clarity in the folders. I want them to use the CSS and HTML icons Sublime uses for .css and .html files. Therefore I opened the Info.plist in the Package Contents and edited it like that:

<dict>
   <key>CFBundleTypeRole</key>
   <string>Editor</string>
   <key>CFBundleTypeName</key>
   <string>SASS</string>
   <key>CFBundleTypeExtensions</key>
   <array>
      <string>sass</string>
   </array>
   <key>CFBundleTypeIconFile</key>
   <string>CSS</string>
</dict>

and for html.twig and email.md.twig

<dict>
   <key>CFBundleTypeRole</key>
   <string>Editor</string>
   <key>CFBundleTypeName</key>
   <string>HTML</string>
   <key>CFBundleTypeExtensions</key>
   <array>
      <string>html</string>
      <string>html.twig</string>
      <string>email.md.twig</string>
      <string>htm</string>
      <string>shtml</string>
      <string>xhtml</string>
      <string>phtml</string>
      <string>inc</string>
      <string>tpl</string>
      <string>tmpl</string>
      <string>tpl</string>
      <string>ctp</string>
   </array>
   <key>CFBundleTypeIconFile</key>
   <string>HTML</string>
</dict>

(FYI, I followed: How to set an icon for a file type on Mac?) Notice, that I use CFBundleTypeIconFile: HTML and CSS, so the icons definitely exist (since they work with .css and .html).

But after closing and moving the whole App to the ~/Desktop launching it and moving it back to ~/Applications, launching it again, nothing happens. I also tried rebooting OS X.

I'm also sure, that I don't have already set a custom icon to these files (via the Info-Dialog). I created some new test.sass etc. files on my desktop to check that.

Does someone have an idea what I'm doing wrong here? And is it even a good idea to edit the Plist.info anyway? What happens when the App gets updated?

Mainquestion: What am I doing wrong here? ;-)

Or: Is there a different way to associate the correct icons for (e.g.) all .sass-files (and not separately for each single file)

THANKS!

share|improve this question
    
To clarify, the files are associated with the Sublime Text 2 program and open in it when double-clicked? –  Daniel Beck Jan 26 '12 at 18:49
    
Cannot reproduce. Here's a screenshot of the Info.plist values used. Have you tried doing this step by step? It could be possible OS X cannot handle two file extensions (html.twig?) and therefore ignores the edited Info.plist file. Maybe try just twig instead. –  Daniel Beck Jan 26 '12 at 18:56
    
Weird. I'll try it on another Mac tomorrow and come back to you. Thanks for testing it yourself. –  madeyourday Jan 26 '12 at 19:34
    
Please keep me informed. Make sure to add @DanielBeck to your comment so I'll get notified. –  Daniel Beck Jan 26 '12 at 19:36
    
@DanielBeck got some Answers, thanks! :-) –  madeyourday Jan 27 '12 at 8:28
add comment

1 Answer

up vote 0 down vote accepted

If you use TotalFinder you need to restart it by typing killall Finder in the Terminal. It seams that TotalFinder has its own icon cache (damn, should have checked that). The second thing I changed, was that I put the SASS-block on top of the CFBundleTypeIconFile array like @DanielBeck did when he tried to reproduce the problem.

The third thing is, like @DanielBeck recommended totally correct: Use just twig instead of xxx.twig since filetypes are read from right to left. html.twig would be a file named html with the extension twig.

share|improve this answer
add comment

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.