Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Autohotkey_L and Windows Explorer


  • Please log in to reply
5 replies to this topic
Puzzled Greatly
  • Members
  • 612 posts
  • Last active: May 22 2017 11:15 PM
  • Joined: 15 Aug 2009
I've started using Windows 7 and switched over to Autohotkey_L at the same time. I'm having some trouble. Is there a way to get the current folder and list of selected files from an open explorer window when pressing a hotkey. Thanks.

GP

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Read the clipboard documentation

Puzzled Greatly
  • Members
  • 612 posts
  • Last active: May 22 2017 11:15 PM
  • Joined: 15 Aug 2009
Thanks for the reply., Sorry, I should have specified without using the clipboard. I know how to do that. Is there not a cleaner method? This is the kind of code I had working before:

GroupAdd, Explore, ahk_class CabinetWClass
GroupAdd, Explore, ahk_class ExploreWClass

#IfWinActive ahk_group Explore
{
explorerClass = ExploreWClass

space::

; Get current path in Explorer
  WinGetClass explorerClass, A
  ControlGetText currentPath, Edit1, ahk_class %explorerClass%
  ControlGet, selectedFile, List, Selected Col1, SysListView321,ahk_class %explorerClass%
   msgbox %currentPath%\%selectedFile%
}



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
COM can be used to access any Explorer windows that are open. You may use jethrow's post as a starting point. (Check the links, and note that Item.HWND can be compared to WinActive("A") to find the active window.)

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
And just a few posts below yours <!-- m -->http://www.autohotke...pic.php?t=65419<!-- m -->

Puzzled Greatly
  • Members
  • 612 posts
  • Last active: May 22 2017 11:15 PM
  • Joined: 15 Aug 2009

COM can be used to access any Explorer windows that are open. You may use jethrow's post as a starting point. (Check the links, and note that Item.HWND can be compared to WinActive("A") to find the active window.)

Thanks for the link. I couldn't work out how to use Item.HWND. I'd appreciate some more help. I looked at Item.LocationURL but that seems a very messy way to get a regular path. I'm finding this much more difficult than I imagined.