aboutsummaryrefslogtreecommitdiff
path: root/tt.programs.explorer.ahk
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2020-12-26 15:40:13 +0100
committerJohn Ankarström <john@ankarstrom.se>2020-12-26 15:40:13 +0100
commitd74a7673e1ce534b5723732d9db4630702d01419 (patch)
treefe4fbace14adf720fbff7751506105bc97a639dc /tt.programs.explorer.ahk
parent8819fddff54d549fe56577c9ae92bd8a57d7beaa (diff)
downloadahk-d74a7673e1ce534b5723732d9db4630702d01419.tar.gz
explorer: Fix and improve new text file hotkey
Diffstat (limited to 'tt.programs.explorer.ahk')
-rw-r--r--tt.programs.explorer.ahk18
1 files changed, 16 insertions, 2 deletions
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 -----------------------------------------------------------