Mac下显示\隐藏所有文件

时间:2023-03-09 04:35:54
Mac下显示\隐藏所有文件

显示Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool true
隐藏Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool false

脚本

tell application "Finder" to quittrydo shell script "defaults read com.apple.finder AppleShowAllFiles"set OnOff to resulton errorset OnOff to ""end tryif OnOff = "" thenset OnOffCommand to "defaults write com.apple.finder AppleShowAllFiles 1"elseset OnOffCommand to "defaults write com.apple.finder AppleShowAllFiles 0"end ifdo shell script OnOffCommanddelay 1tell application "Finder" to launch

复制代码保存为*.scpt, 双击后选择运行就ok!