有时候我们希望在 Finder 直接查看一些以“.”开头的隐藏文件,现在我们能直接通过创建 Finder 中的服务来实现快速开启或关闭查看隐藏文件的功能。

在 Automator 中创建一个服务,并按照如下图片和代码来设置,保存即可。

if [ `defaults read com.apple.finder AppleShowAllFiles` != "TRUE" ]
then
defaults write com.apple.finder AppleShowAllFiles TRUE
else
defaults write com.apple.finder AppleShowAllFiles FALSE
fi
killall Finder