Prevent an application's Dock icons from showing in OS X
If needed, you can reduce Dock clutter by hiding the icon for persistent background and helper applications.
The OS X Dock offers a quick and convenient way to launch programs and manage ones that are currently open; however, there are times when a program you are using doesn't have any purpose in being presented in the Dock. For example, Dropbox is managed solely in the menu bar, so having a Dock icon will add no benefit and will only clutter the Dock.
This is the case with other programs that are intended to run as background helpers, or as menu extras, but sometimes this is not the case. For instance, if you are required to use Cisco's AnyConnect VPN software, then you may find that it runs as a menu extra but also has a Dock icon. The program does try to hide when the VPN is connected, but the Dock icon will remain as long as the program is open, and may be a bit of a clutter.
In this and similar cases, it would be beneficial to have the program run, but not be represented in the Dock. Luckily, there is a way to do so.
By default any packaged application bundle (files that end with ".app" as the suffix) in OS X will be represented in the Dock when opened, but developers have the option of preventing this by including a small bit of information in the program's information property list. This file is a small settings file within the application itself, which holds information such as the program's current version, minimum OS requirements, and the type of application, among many other details.
To get to this file, simply right-click the program in the Finder and choose "Show Package Contents," followed by opening the "Contents" folder in the window that appears. In here, locate the file called "Info.plist" which is a small text file in Apple's Property List XML format. As with all property lists, this file is organized in a key-and-value structure, so to instruct the system to prevent the program from displaying in the Dock, we simply need to add the following key and value to this file:
To do this, open the file in a text editor (Apple's TextEdit will work, but I recommend TextWrangler), and then search for the term "LSUIElement" using standard find functions. If found, then change the value for this key to "true," as shown above, and save and close the file. If the search reveals nothing, then insert the two key-and-value lines at the bottom of the file, just above the closing "</dict>" tag, so the file looks like the following:
Now save and close the file, and when you next launch the program it will not show up in the Dock. In the case of Cisco AnyConnect, the program will open, show its menu extra, and function normally in all intended ways, but not clutter the Dock.
While this can be useful for programs like AnyConnect, it should not be done arbitrarily for any program. If you do this for a word processing program like Pages, then after launching it, you will find switching back and forth between it and other programs to be a daunting if not impossible task. Therefore, reserve this for programs that either run as menu extras, background services, or helpers such as applescript applications.
Do keep in mind that editing a file in the program package will break any code signatures associated with it. This should not affect the program itself, but depending on GateKeeper security settings for your system you may need to right-click the program so an exception can be made and it will be allowed to run.