美文网首页
mac快捷新建文件

mac快捷新建文件

作者: kangshuaibo | 来源:发表于2018-04-30 14:36 被阅读0次

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

    Automator 新建一个 Application

    <figure>

    <noscript><img src="https://pic1.zhimg.com/50/78ce627667e5b8c7ab1bcff125e19968_hd.jpg" data-rawwidth="97" data-rawheight="109" class="content_image" width="97"></noscript>

    image

    </figure>

    添加一个动作 "Run AppleScript"

    <figure>

    <noscript><img src="https://pic3.zhimg.com/50/b1931d5f1328d30559719088c9faffb1_hd.jpg" data-rawwidth="1816" data-rawheight="1088" class="origin_image zh-lightbox-thumb" width="1816" data-original="https://pic3.zhimg.com/b1931d5f1328d30559719088c9faffb1_r.jpg"></noscript>

    image

    </figure>

    代码如下

    on run {input, parameters}
    
        tell application "Finder"
        set selection to make new file at (get insertion location)
        end tell
    
        return input
    end run
    
    

    保存到 "应用程序"文件夹, 名字姑且叫 "New File.app" 吧.

    Finder 工具栏右键, 自定义, 然后把 New File.app 拖上去, 大功告成,

    <figure>

    <noscript><img src="https://pic3.zhimg.com/50/37e5280342c09c90f09f880d84ef1250_hd.jpg" data-rawwidth="711" data-rawheight="442" class="origin_image zh-lightbox-thumb" width="711" data-original="https://pic3.zhimg.com/37e5280342c09c90f09f880d84ef1250_r.jpg"></noscript>

    image

    </figure>

    需要时候点击一下, 即可在当前文件夹生成一个空文件.

    ========================================

    如果你用 Alfred 这个神器, 直接敲 new 就可以了.
    如图, 刚刚上面造的小工具也可以用 Alfred 调用, 同样好使.

    <figure>

    <noscript><img src="https://pic4.zhimg.com/50/d16ec212ba96c51f7efa0089bc9a7239_hd.jpg" data-rawwidth="560" data-rawheight="262" class="origin_image zh-lightbox-thumb" width="560" data-original="https://pic4.zhimg.com/d16ec212ba96c51f7efa0089bc9a7239_r.jpg"></noscript>

    image

    </figure>

    相关文章

      网友评论

          本文标题:mac快捷新建文件

          本文链接:https://www.haomeiwen.com/subject/nvwzlftx.html