aboutsummaryrefslogtreecommitdiff
path: root/tt.programs.explorer.ahk
diff options
context:
space:
mode:
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 -----------------------------------------------------------