mac 配置隐藏文件是否显示脚本方法

方法一

1.打开mac下的 AppleScript脚本编辑器

2.把下面的代码复制到脚本中

display dialog "隐藏/显示隐藏文件" buttons {"可见", "隐藏"} 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.运行即可

方法二

1. 在终端中执行(true显示,false隐藏)

defaults write com.apple.finder AppleShowAllFiles -bool true

2.重启finder即可

你可能感兴趣的:(mac 配置隐藏文件是否显示脚本方法)