正如 Ken White 所说,您已经在 Windows 资源管理器中内置了它,右键单击 > 新建 > 新建文本文档,所以让另一个人做同样的事情有点毫无意义。
但是,如果您想使用 AutoHotKey 更有效、更快地创建新的文本文件,那么我会推荐这个脚本
SetTitleMatchMode RegEx
MsgBox, 64, NewTextFile, USAGE: When in a folder in Windows Explorer press Ctrl + Shift + T to create empty text file.`nIf you press multiple times, multiple files will be created (e.g. NewTextFile0.txt, NewTextFile1.txt)
#IfWinActive ahk_class ExploreWClass|CabinetWClass
^+t::
NewTextFile()
return
#IfWinActive
NewTextFile()
{
WinGetText, full_path, A
StringSplit, word_array, full_path, `n
Loop, %word_array0%
{
IfInString, word_array%A_Index%, Address
{
full_path := word_array%A_Index%
break
}
}
full_path := RegExReplace(full_path, "^Address: ", "")
StringReplace, full_path, full_path, `r, , all
IfInString full_path, \
{
NoFile = 0
Loop
{
IfExist %full_path%\NewTextFile%NoFile%.txt
NoFile++
else
break
}
FileAppend, ,%full_path%\NewTextFile%NoFile%.txt
}
else
{
return
}
}
当你运行它并且你在使用 Windows 资源管理器(或桌面)的文件夹中时,按 Ctrl+Shift+T 来创建新的文本文件,只要你愿意。
https://github.com/ilirb/ahk-scripts/blob/master/executable/source/NewTextFile.ahk