Reputation: 125
I changed the Dock properties to show the "Remove from Dock" option for Finder and Trash (tutorial here). But the Dock displays these icons in the Dock by default every time it is launched, so you have to use an AppleScript to click automatically this option in each icon's menu.
tell application "System Events"
tell application process "Dock"
set frontmost to true
try
perform action "AXShowMenu" of UI element "Trash" of list 1
click menu item "Remove from Dock" of menu 1 of UI element "Mail" of list 1
end try
end tell
end tell
Problem: this script is not "universal", i.e. the "Remove from Dock" option, and even the name of the Trash changes in each language.
So I thought about making a shell script to remove these icons, but you have to restart the Dock (killall Dock
), which makes the Finder and the Trash reappear...
How to delete these items? Maybe change the Dock preferences which make the Finder and Trash appear by default?
Upvotes: 2
Views: 271