Created
May 8, 2012 11:38
-
-
Save nikreiman/2634396 to your computer and use it in GitHub Desktop.
Remove finder's dock icon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Remove Finder's Icon in the Mac OSX Dock | |
-- This is useful if you want to keep Finder running alongside Path Finder, | |
-- but don't want to see it's icon in the Dock or in the list of running | |
-- applications. | |
-- | |
-- Taken from Jampe's post on the Cocoatech forums: | |
-- http://forum.cocoatech.com/archive/index.php/t-1803.html | |
-- If the dock is hidden, sometimes this doesn't really work | |
-- So show the dock before removing, and autohide it again afterwards | |
tell application "System Events" to set the autohide of the dock preferences to false | |
set remove to true | |
tell application "System Events" | |
tell process "Dock" | |
tell list 1 | |
try | |
set FinderDockItem to UI element "Finder" | |
on error | |
set remove to false | |
end try | |
if remove then | |
tell FinderDockItem | |
perform action "AXShowMenu" | |
click menu item "Remove from Dock" of menu 1 | |
end tell | |
end if | |
end tell | |
end tell | |
end tell | |
tell application "System Events" to set the autohide of the dock preferences to true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment