赶知识网

在 Mac - Finder 中显示隐藏文件

2021-01-19 / 1641次点击 OS/操作系统 Mac Finder

是要在 Finder 中显示隐藏文件吧?那么,可以使用defaults write com.apple.finder AppleShowAllFiles -bool true;
KillAll Finder

这条命令来显示。同时,将 true 改成 false, 就可恢复隐藏状态。鼓捣过一个 AppleScript, 做了个有 GUI 的小程序。可以打开 AppleScript 编辑器 这个自带 App, 新建一个文档,将下面的代码粘贴进去,编译,然后导出 .app 应用程序,方便切换显示/隐藏两个状态。

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

作者:Linkzero Tsang
链接:https://www.zhihu.com/question/24635640/answer/28455134
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

有用 0 没用 0

Top10

沪ICP备09053415号 © 赶知识网