Lion 里如何快速切换隐藏文件的显示?

2012-03-05 22:59:02 +08:00
 dofine
google到可以用 defaults write blabla 的方法,请问有没有更快捷的呢?
4776 次点击
所在节点    问与答
8 条回复
sparanoid
2012-03-05 23:16:04 +08:00
用我的 Workflow 吧: http://d.pr/Cd5D

执行一次,显示,再执行,隐藏,Finder 期间会自动重新运行
hzlzh
2012-03-05 23:53:54 +08:00
我不切换,永久显示隐藏文件。习惯了
yyfearth
2012-03-05 23:55:44 +08:00
totalfinder shift+cmd+.
wynnsyt
2012-03-06 00:21:40 +08:00
totalfinder +1
dofine
2012-03-06 21:27:58 +08:00
@sparanoid @hzlzh @yyfearth @wynnsyt

谢谢你们~~四个人就给出了三个答案~谢谢~
panlilu
2012-03-06 21:32:30 +08:00
try
do shell script "defaults read com.apple.finder AppleShowAllFiles"
on error
get 0
end try

set i to (result + 1) mod 2 -- Get opposite of current value

tell application "Finder"
activate
get item (i + 1) of {"Hide", "Show"}
display dialog (result & " all hidden files in Finder?") buttons {"Cancel", (result & " Hidden Files")} default button 2 with icon note
quit
end tell

delay 0.5

try
do shell script "defaults write com.apple.Finder AppleShowAllFiles " & i
launch application "Finder"
on error errorMsg number errorNum
display dialog "Error (" & errorNum & "):" & return & return & errorMsg buttons "Cancel" default button 1 with icon caution
end try


----
上面的apple script运行一下就好了
dofine
2012-03-06 22:59:02 +08:00
@panlilu thx, i'll try it!
yangg
2012-03-07 10:06:21 +08:00
# show or hide All Files/Desktop Icons/Filename extentions in Finder
# Usage:
# show <command> [switch]
# command can be allfile/desktop/ext
# $ show allfile
# or
# $ show desktop 1
show() {
package="com.apple.Finder"
case ${1:-allfile} in
allfile) name="AppleShowAllFiles";;
desktop) name="CreateDesktop";;
ext) name="AppleShowAllExtensions";package="NSGlobalDomain";;
esac
if [ "$2" = "" ]; then
state=`defaults read $package $name`
if [ "$state" = 0 ]; then val=1; fi
else
val="$2";
fi
if [ "$val" = 1 ]; then val=true; else val=false; fi
defaults write $package $name -bool $val && killall Finder
}

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/28846

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX