显示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!