apple script 可以解决问题

#apple script可以解决 scpt文件, 用苹果工具script editor编辑
tell application "Finder" to make new file at (the target of the front window) as alias
#然后记得保存为app, 如果保存为script, 则无法直接执行.
tell application "Finder" to make new file with properties {name:"readme.md"} at (the target of the front window) as alias
#这一句把默认文件名改为readme.md
  • 步骤
    1. 打开apple script 输入上面的脚本
    2. 另存为app ,另存为app
    3. 按住⌘, 把app拖到finder的工具栏
    4. 大功告成, 任何目录都能弄这事了.
  • https://www.maketecheasier.com/create-blank-text-file-mac/

然后, 问题来了, 如果目录下面已经有了readme.md, 咋办? 已经决定放弃applescript, 改为用nodejs解决问题.