F2 to Rename a document in File Explorer

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
smorley
Posts: 1
Joined: 26 Sep 2022, 11:41

F2 to Rename a document in File Explorer

Post by smorley » 26 Sep 2022, 11:46

Hi key people,
This one seems simple, but I keep looping in circles when I search.

When I open up Windows File Explorer, I want to be able to hit F2 and it allows me to edit the file name. Right now, it's Function-F2. I'm also hoping the same happens when I'm in Excel.

RussF
Posts: 1229
Joined: 05 Aug 2021, 06:36

Re: F2 to Rename a document in File Explorer

Post by RussF » 26 Sep 2022, 12:08

Welcome to the AHK forum!

This question has been asked many times. AHK typically does not have access to the Fn key. Often, it's possible to change a setting in the PC's BIOS that changes the Fn key from activating function keys to activating the other capabilities on those keys (screen dim, volume, etc.) Some cannot be changed - hopefully yours can.

Russ

ahk7
Posts: 572
Joined: 06 Nov 2013, 16:35

Re: F2 to Rename a document in File Explorer

Post by ahk7 » 26 Sep 2022, 12:46

Well, how about "clicking" the rename button in the "ribbon bar" or "quick access toolbar".
You can send mouse clicks to the button. The button should/probably is always be in the same position so you can use coordinates (relative to the window), or
- ImageSearch (to find the button),
- FindText (viewtopic.php?f=6&t=17834 similar to imagesearch but doesn't use an image)
- and for some very advanced stuff UIAutomation viewtopic.php?f=6&t=104999

Post Reply

Return to “Ask for Help (v1)”