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, 则无法直接执行.
  • 步骤
    1. 打开apple script 输入上面的脚本
    2. 另存为app ,另存为app
    3. 按住⌘, 把app拖到finder的工具栏
    4. 大功告成, 任何目录都能弄这事了.
  • https://www.maketecheasier.com/create-blank-text-file-mac/

open in也可以解决问题

  1. 地址: : https://github.com/cnstntn-kndrtv/open-in-buttons-for-finder-toolbar
  2. 如何在目录中新建一个文件,
  3. 怎样在进入terminal的时候指定当前目录(虽然可以拖入, 但是还要费一步)
#脚本很令人惊讶, 就一句话. 注意这个是workflow文件. 用automator
while read file; do /usr/local/bin/mate "$file"; done

nufile和document palette

https://www.macworld.com/article/1151236/os-x/createnewfileservice.html

on run {input, parameters}
  tell application "Finder"
    set currentPath to insertion location as text
    set x to POSIX path of currentPath
  end tell
  return x
end run

https://apple.stackexchange.com/questions/94755/right-click-create-a-new-text-file-how

tell application "Finder"
    insertion location as alias is desktop as alias
    container of item 1 of (get selection) as alias is desktop as alias
end tell