Create a text file or other format in active directory in explorer

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
coreilabs
Posts: 2
Joined: 19 Mar 2022, 18:27
Contact:

Create a text file or other format in active directory in explorer

19 Mar 2022, 18:39

How to create any filetype in any folder of explorer, 2 methods with file name prompt and automatic
Auto get explorer path
Don't working in Desktop, if someone can help to inprove this, it will be welcome
Slava Ukraine :clap:

Code: Select all

#SingleInstance Force
Exit 

getRandom(){
s := (s := "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z") "," s "," s
Sort, s, Random D,
i := SubStr(StrReplace(s, ","), 1, 4)
return i
}
getPath(){
	ControlGetText, var, ToolbarWindow323, A
	;English windows version has to change "Endereço: " to "Adress: " 
	var2 := StrReplace(var, "Endereço: ")
	Return var2
	}

F1:: ; F1 hotkey

; new txt file random name without prompt

; fullPath := getPath()
; random := getRandom()
; FileAppend, This is a blank line`n, %fullPath%\Novo-%random%.txt

; new file with prompt filename and extension prompt
random := getRandom()
fullPath := getPath()
InputBox, fileName, Type the file name, Type filename with extension (file.txt), ,,,,,,,file-%random%.txt
FileAppend, This is a blank line`n, %fullPath%\%fileName%

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: apeironn, Google [Bot], Mateusz53, mikeyww, Spawnova and 157 guests