From d74a7673e1ce534b5723732d9db4630702d01419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 26 Dec 2020 15:40:13 +0100 Subject: explorer: Fix and improve new text file hotkey --- tt.programs.explorer.ahk | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'tt.programs.explorer.ahk') diff --git a/tt.programs.explorer.ahk b/tt.programs.explorer.ahk index 20296c3..3deb9d6 100644 --- a/tt.programs.explorer.ahk +++ b/tt.programs.explorer.ahk @@ -57,8 +57,22 @@ return ; Create new file ^!n:: -FileAppend,, % ExplorerPath() "\New Text Document.txt" -SendInput, {F5}New Text Document.txt{F2} +path := ExplorerPath() "\" +pre := "Nytt textdokument" +post := ".txt" +if (FileExist(path pre post)) +{ + n := 2 + while (FileExist(path pre " (" n ")" post)) + n += 1 + name := pre " (" n ")" post +} +else + name := pre post +FileAppend,, % name +SendInput, {Esc}{F5} +Sleep, 80 +SendInput, % name "{F2}" return ;; Explorer hotkeys ----------------------------------------------------------- -- cgit v1.2.3