AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New Folder In Explorer

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
dandersahn



Joined: 06 Oct 2008
Posts: 13

PostPosted: Wed Nov 12, 2008 5:18 pm    Post subject: New Folder In Explorer Reply with quote

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
View user's profile Send private message
BoBo²
Guest





PostPosted: Wed Nov 12, 2008 6:11 pm    Post subject: Reply with quote

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

PostPosted: Wed Nov 12, 2008 6:29 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group