Any way to keep a script's icon from appearing in the Dock?

I have an Applescript that I need to run but it keeps showing up in the dock whenever I click on it. Can somebody tell me how to make it so it’s icon will not appear in the Dock? It’s taking up too much room as it’s already crowded! :slight_smile:

The only way to make an item NOT show up in the dock, is to use the LSUIElement plist property for the application. In the ‘info.plist’ file for the application, add this key-value pair to the main dictionary…

This can only be done with bundle-based applications, such as “application bundle” scripts and applescript studio projects. In a script it removes the dock icon, while in an applescript studio project it removes the dock icon and the main menu. One thing to consider is that in removing these ui elements from visibility, you eliminate your method of quitting the application. You must either provide a mechanism in your app to quit it like test for a condition and then quit itself, a button in a persistent dialog or window, or create a separate script or app that can be run to quit it (and perhaps itself)…

on run
	tell application "MyHiddenApp" to quit --> Quit the hidden app
	quit --> Quit the closer app
on run

Otherwise, sounds lke it’s time to thin out your dock and find another method of launching your apps. Have fun… 8)

Jobu…I’ve tried what you suggested, but I must not be doing it right.

In PList editor, what steps would i take? Do I add as two seperate entries? Are they as strings? and which dictionary…i have root and window state.

also, couldn’t background applications like this be closed from terminal?..or in Activity Monitor?



I prefer to navigate to my app in the finder and open it’s info.plist in a text editor and edit by hand. If you want to use the plist editor or the editor in xcode, it will code all the syntax for you, you just need the content for the key and value fields. In plist editor, in the ROOT directory, choose “New Sibling”. Name it “LSUIElement”, and make it’s value “1” (as a string). Doing this in xcode is similar, and can be found in the expert view under info.plist while viewing the target.

There are certainly many ways to quit an app. If you can come up with one that will find and quit a hidden/faceless application, please feel free to use it. I personally do not want to have to log in to terminal every time I want to shut down an app that I’m only hiding because my dock is cluttered. I park a script like the following in an easy to reach place, so I can find and list all of the current processes and quit them at will…

tell application "Finder"
	set appList to name of every application process
end tell
set toQuit to (choose from list appList)
if toQuit is not false then
	tell application (toQuit as string)
	end tell
end if



Not sure about Panther but prePanther AppleScript versions save script applications with a SIZE resource with a background only flag. I think this app does that:


I am running into the same issue now. I have an AppleScript saved as an “Application Bundle” and I’d like it to run with no dock menu. I’ve added the key>LSUIElement

to info.plist with both 0 and 1 as a value (both suggested on this board, but Apple’s docs say it’s “1”)

and neither has any effect.

Any guidance would be much appreciated!

I was looking to do this on a little utility I just made. I couldn’t get it done either.

So a quick google search turned up an app called Dockless found here…

It worked on my app, but it made the whole thing invisible… no dock icon, no window, no nothing… so I changed it back. Funny thing though, I looked at the info.plist, and sure enough it created that “LSUIElement” key. The value of the key was string and 1 for hidden and 0 for visible. I tried changing it from 1 to 0 myself to make it visible again… it didn’t work… so I used Dockless to make it visible and it worked! I looked and the key was 0 again. I don’t know why it didn’t work when I tried manually??? I tried using property list editor and textedit, but couldn’t get either to do the job for me!!!