 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
dandersahn
Joined: 06 Oct 2008 Posts: 13
|
Posted: Wed Nov 12, 2008 5:18 pm Post subject: New Folder In Explorer |
|
|
I'm trying to create a hotkey to create a new folder in Windows Explorer. Doesn't seem like it should be hard, but I can't get it to work consistently. I have had no success with WinMenuSelectItem and limited success with PostMessage. When I use post message, the success of the script depends on something to do with what is focused in the Explorer window.
Here's my code:
| Code: | #IfWinActive, ahk_class CabinetWClass
^=::
#IfWinActive, ahk_class ExploreWClass
^=::
WinGet, active_id, ID, A
;WinMenuSelectItem, ahk_id %active_id%,, File, New, Folder
;PostMessage, 0x111, 30816, 0, , ahk_id %active_id%
PostMessage, 0x111, 30735, 0, , ahk_id %active_id%
return |
Using windows spy, I have found two different messages, but using both doesn't work all the time either. I assume that if I can send the message to a specific control, I could get this to work, but I can't figure out how to do that.
I imagine that I'm not the first person to ask this, but I couldn't figure out a search that didn't return all kinds of unrelated posts. Any help would be appreciated. Thanks. |
|
| Back to top |
|
 |
BoBo² Guest
|
Posted: Wed Nov 12, 2008 6:11 pm Post subject: |
|
|
| Code: | !y:: ; press ALT+y
WinGetTitle, MyTitlePath
Run, cmd /c md "New Folder", %MyTitlePath%, Hide
Send, {F5}
Return | Not tested. |
|
| Back to top |
|
 |
dandersahn
Joined: 06 Oct 2008 Posts: 13
|
Posted: Wed Nov 12, 2008 6:29 pm Post subject: |
|
|
Thanks. That won't quite work for me because I don't use the full path title option for Explorer windows and it also won't work for "special" folders like "my documents". I would also like to mimic the menu function if possible. I like that the new folder is created with the name selected already for editing. It's possible to do what I want using send keys functions as well, but I have an unjustified problem with flashing menus  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|