Skip to content

Instantly share code, notes, and snippets.

@GENiEBEN
Created January 20, 2020 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GENiEBEN/e0f82c4d5156f4982f1c3a4a7c5a4281 to your computer and use it in GitHub Desktop.
Save GENiEBEN/e0f82c4d5156f4982f1c3a4a7c5a4281 to your computer and use it in GitHub Desktop.
Tray script that monitors every folder selected or entered in Explorer.
Previous=
Current=
Loop
{
Current :=GetExplorerSel()
If (Previous <> Current)
{
TrayTip, You have selected, %Current%, 10, 1
Previous = %Current%
}
Sleep, 100
}
GetExplorerSel(hwnd="") {
hwnd := hwnd ? hwnd : WinExist("A")
WinGetClass class, ahk_id %hwnd%
If (class="CabinetWClass" or class="ExploreWClass")
For w in ComObjCreate("Shell.Application").Windows
If (w.hwnd==hwnd)
{
sel := w.Document.SelectedItems
For i In sel
ret .= i.path "`n"
return Trim(ret,"`n")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment