Sublime Forum

Sublime Text does not show in the open menu for .log ext on Mac Os

#1

I am on Mac Os Sierra, running Sublime Text build 3126. A number of file extensions work correctly, i.e. right-click on a .java file or .json file and I see Sublime Text in the open with dialog. However if I do the same with a file ending in .log, Sublime Text doesn’t appear and I have to select Other and locate Sublime Text from items in the applications folder.

I have fixed this on my machine but it may not survive an update and maybe there is a “Sublime Text” way of accomplishing this. Here is what I did.

I went to the Sublime Text.app, did show package. Then I went into Contents and edited info.plist, and yes I had backups :slight_smile:
I changed the following adding the log extension:

CFBundleTypeRole
Editor
CFBundleTypeName
Plain Text
CFBundleTypeExtensions

txt
log</string

CFBundleTypeIconFile
TEXT

Then I did lsregister -f /Applications/Sublime\ Text.app
so that it would re-read the info.plist and add the log extension and I can now right click on a .log file and have it opened from the menu without the extra work of having to look through the Applications.

Sorry about the length, so is there another way that is more lasting or is it possible that this extension could be added to the info.plist file as a default?

Thanks for you time in advance.
Dennis

0 Likes

#2

I have no idea how file types on MacOS work, but it seems like someone else is trying to do the same thing as you here:

0 Likes

#3

Hi Kingkeith, My posting was not quite what was intended. I tried to show the part of the info.plist file that I changed, i.e. xml, but the forum posting didn’t show everything that I included. I tried quoting and other tricks but nothing seemed to help. Anyway, I want Sublime Text to show up in the open dialog for a file with a .log extension. As installed it never shows up. I know this is probably a Mac issue, but it would be nice if this mapping came with new versions of Sublime Text. I guess I’m assuming that .log files will be the same as .txt files, and for my case they are. Without my change I have to select other in the open dialog, which shows me possible applications in the applications folder, and I can select Sublime Text to then open the file, but its a lot of extra clicks everytime I want to open a file with a .log extension. My solution works, but if for instance I install an upgraded version of Sublime text in the future, then I will have to redo my change.

Hope this help explain why I think it would be useful to others. I’m a developer and I’m looking at lots of .log files while doing my job, so for me it would be a big win.
Thanks

0 Likes