在Mac的Finder中,想增加一个txt或者markdown挺痛苦的,很多同学通过shell解决,给大家提供一个apple script, 将它保存成app,然后放到finder状态栏,就可以直接在当前finder路径添加txt了,而且文件名还可以自己设置
:
set userResonse to text returned of (display dialog "输入新建的文本文件名" default answer "new file.txt" buttons {"取消", "确认"} default button "确认")
tell application "Finder"
if exists Finder window 1 then
make new file at (target of front Finder window as text) with properties {name:userResonse}
else
make new file at (path to desktop) with properties {name:userResonse}
end if
end tell
set userResonse to text returned of (display dialog "输入新建的文本文件名" default answer "new file.txt" buttons {"取消", "确认"} default button "确认")
tell application "Finder"
if exists Finder window 1 then
make new file at (target of front Finder window as text) with properties {name:userResonse}
else
make new file at (path to desktop) with properties {name:userResonse}
end if
end tell
展开
5
2