How do I make F1 be a hotkey in Windows XP assigned to creating a new folder?
I don't know too much about programming or scripting. Can AutoHotkey do this?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Yup. Use FileCreateDir.
windowText = line = path = name = $F1:: ;the $ locks the keystroke so you don't get Windows Help IfWinNotActive, ahk_class CabinetWClass Return ;If the active window is not an explorer window, do nothing WinGetText, windowText, ahk_class CabinetWClass, ;get text info StringSplit, line, windowText, `n ;take the first line of windowText this will be "Address: path" StringReplace, path, line1, Address: ` ;trim off Address: StringTrimRight, path, path, 1 ;trim off new line character at the end InputBox, name, MakeDirF1, Enter the name of the new folder. ;get a name If name == "" ;if name is blank name := "New Folder" ;then set name FileCreateDir, %path%\%name% ;create the folder If ErrorLevel == 1 ;check for errors MsgBox, Error!`n`n%A_LastError% ;message box if error Return