V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
dofine
V2EX  ›  问与答

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

  •  
  •   dofine · 2012-03-05 22:59:02 +08:00 via Android · 4657 次点击
    这是一个创建于 4435 天前的主题,其中的信息可能已经有所发展或是发生改变。
    google到可以用 defaults write blabla 的方法,请问有没有更快捷的呢?
    8 条回复    1970-01-01 08:00:00 +08:00
    sparanoid
        1
    sparanoid  
    MOD
       2012-03-05 23:16:04 +08:00
    用我的 Workflow 吧: http://d.pr/Cd5D

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

    谢谢你们~~四个人就给出了三个答案~谢谢~
    panlilu
        6
    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
        7
    dofine  
    OP
       2012-03-06 22:59:02 +08:00 via Android   ❤️ 1
    @panlilu thx, i'll try it!
    yangg
        8
    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
    }
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2913 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 14:31 · PVG 22:31 · LAX 07:31 · JFK 10:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.