Litao OK Blog

A little blog for my life.

Mac OS X解决文件“打开方式”菜单中应用名称重复出现的问题

在终端窗口输入下面命令即可:

1
2
3
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/\
LaunchServices.framework/Versions/A/Support/\
lsregister -kill -r -domain local -domain user

或者:

1
2
3
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user
killall Finder
echo "Open With has been rebuilt, Finder will relaunch"

运行这条命令号,Launch服务数据库将被重建,重建之后重复的应用名称就会消失。当然有的是偶你可能需要退出,然后重新启动Finder才能看到效果,使用下面这条命令迅速重启Finder:

1
killall Finder

打开.bash_profile来创建快捷命令,这样就不用每次输入上面这么长的命令了:

1
alias macxfix='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"'