How can I add a program to the "Open With" menu on a Mac?
3 Answers
Do you mean the submenu you get when right-clicking on a document? If so, it's generated automatically by Launch Services based on the document types your applications claim to be able to handle. If you look inside an application package (right-click the application, and select Show Package Contents), inside the Contents folder there'll be an Info.plist file with various information about the application, including an array of document types it can open (see Apple's dev documentation here).
TLDR; if the application handles that type of document, it should already be listed; if not, I don't know a way to add it manually.
- 34,084
- 5
- 66
- 70
-
1by editing the `plist` file, of course! – Daniel Beck Dec 14 '10 at 21:21
-
@Daniel Beck: that'd work, although it's likely to get reverted the next time you update the app, and will also invalidate the app's code signature (since you've tampered with it). – Gordon Davisson Dec 14 '10 at 22:42
-
@Gordon True. It all depends on how important this is for you. I kept this up for a while to get rid of the ridiculous `NewsFireItemType` type name for NewsFire's spotlight compatibility items, but it became boring really fast. – Daniel Beck Dec 15 '10 at 02:25
-
Ok I added it to the list, do I have to reboot or something for it to take effect? – Chris Dec 15 '10 at 21:55
-
@Chris You need to make Launch Services aware of the changes. I *think* moving the application around might do the trick. From `/Applications` to `~/Applications`, then start and quit again, then move back. Alternatively, try to trash and restore. – Daniel Beck Dec 16 '10 at 06:03
-
@Chris I think Daniel's suggestion will work, but if it doesn't try running `/Volumes/Leopard\ HD/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f /path/to/application.app` (and yes, that's all one long command line). – Gordon Davisson Dec 16 '10 at 06:24
-
@Dainiel_Beck taking the application out of the folder and putting it back in did the trick.. Thanks! – Chris Dec 16 '10 at 13:55
-
Nah, all that's needed is to `touch` the application bundle (the Finder, and NSBundle/CFBundle cache the list of contents for performance reasons). The most basic operation is to use the Terminal to touch the "MyCoolApp.app", (drag it from the Finder to the Terminal window to automatically add path). Then deselect the app, then reselect it in the Finder (when it notices newer mod date, it re-registers it). Alternatively, moving it causes the Finder to "unregister" the app in the old location and then "register" it in the new location. – NSGod Dec 19 '10 at 04:53
-
1I would like to add Quicksilver to show up on the "Open With" program for every file type. The info.plist already has a "*" entry for the CFBundleTypeExtensions, but it doesn't look like it is being recognized. Wish there was an easier way to get a program to show up on every file's open with... – cwd Apr 19 '11 at 20:05
If you open the "Get Info" window for a file type you're interested in modifying (control click + "Get Info" or ⌘ command + I while the file is selected), you can change the program to the one you want and click "Change All". I've found that this then modifies the "Open With" menu so that if you control click and go to "Open With" now it will show that application because it is the new default. The only downside is that you have to make it the default (I tried changing it back after this and it didn't stick).
It's not quite the perfect solution, but works well enough in my particular case and may be useful for others, and it should be easier / more stable than the plist solution.
macOS High Sierra 10.13.5 (17F77)
- 133
- 1
- 9
If you've used Script Editor or Automator to make a droplet for an app, when you want the droplet added to the "Open With" list, you can do the following:
As always, save a backup copy of any app/system files you're planning to modify!
-- just in case anything goes wrongCopy the target file extension array from an app that is listed in the "Open With" list from the app's info.plist file, and paste it into the CFBundleDocumentTypes array in your target app's info.plist (right click on app, choose "Show Package Contents"). For this example, I'm showing the before/after of the
VLC droplet.appinfo file after replacing the wildcard extension ("*") data with a few file types from theVLC.appinfo file:
"/Applications/VLC droplet.app/Contents/Info.plist":
Before:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
AFTER:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFile</key>
<string>aiff.icns</string>
<key>CFBundleTypeName</key>
<string>AIFF file</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>public.aiff-audio</string>
<string>public.aifc-audio</string>
</array>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>divx</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>movie.icns</string>
<key>CFBundleTypeName</key>
<string>DivX file</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeIconFile</key>
<string>m4v.icns</string>
<key>CFBundleTypeName</key>
<string>MPEG-4 File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>public.mpeg-4-audio</string>
<string>com.apple.m4v-video</string>
<string>public.mpeg-4</string>
</array>
</dict>
</array>
- Open terminal, and enter the following command, changing
<TARGET_APP>to the name of the app you are editing the info.plist for to add it to the "Open With" list:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f "/Applications/<TARGET_APP>.app/"
- Enter the command
killall Finderto force restart Finder.
If the application is signed, modifying an Info.plist invalidates the code signature. It also makes a few applications like TextEdit and WriteRoom crash on launch on 10.8.
NOTE: I grabbed some of the info for this answer and edited it to update it with a bit more detailed info/explanation. The original thread is located here.
- 2,047
- 2
- 13
- 19
