mac快捷新建文件

作者: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>

11058807-ff7252281327742a.jpg
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>

11058807-aca1f2a95941ea29.jpg
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>

11058807-55103d62e4e57304.jpg
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>

11058807-54e88077407c6b70.jpg
image

</figure>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值