方法一
1.打開(kāi)mac下的 AppleScript腳本編輯器
2.把下面的代碼復(fù)制到腳本中
display dialog "隱藏/顯示隱藏文件" buttons {"可見(jiàn)", "隱藏"} with icon 2 with title "Switch to presentation mode" default button 1
set switch to button returned of result
if switch is "隱藏" then
do shell script "defaults write com.apple.finder AppleShowAllFiles -bool false;
KillAll Finder"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles -bool true;
KillAll Finder"
end if
3.運(yùn)行即可
方法二
1. 在終端中執(zhí)行(true顯示,false隱藏)
defaults write com.apple.finder AppleShowAllFiles -bool true