Sublime Text 2: Editing associated filetypes in Plist.info won't work

0

1

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!

woerndl

Posted 2012-01-26T18:32:30.200

Reputation: 475

To clarify, the files are associated with the Sublime Text 2 program and open in it when double-clicked? – Daniel Beck – 2012-01-26T18:49:14.797

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 – 2012-01-26T18:56:05.067

Weird. I'll try it on another Mac tomorrow and come back to you. Thanks for testing it yourself. – woerndl – 2012-01-26T19:34:19.310

Please keep me informed. Make sure to add @DanielBeck to your comment so I'll get notified. – Daniel Beck – 2012-01-26T19:36:00.167

Answers

0

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.

woerndl

Posted 2012-01-26T18:32:30.200

Reputation: 475