how can i change the folder in an in/active window via hotkey Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Sarusei
Posts: 3
Joined: 28 Mar 2016, 18:49

how can i change the folder in an in/active window via hotkey

18 Nov 2016, 09:54

what i want a hotkey to do:
after pressing the hotkey
a specifivic window should be selected let's say i use WinActivate for that
then the directory should be changed to a subdirectory of that folder
e.g.:
pressing hotkey
-> folder "C:\newF" was activated
--> chage directory of this folder to a subfolder "C:\newF\one"

this is how far i've made it ....

Code: Select all

pathToF := "C:\newF"
IfWinExist, %pathToF% ahk_class CabinetWClass
{
	WinActivate, %pathToF% ahk_class CabinetWClass
} else {
	run, %pathToF%
}
but what comes next?
how can i change the directory to show me another one(subdirectory in this case "c:\newF\one") in the Active window

i would imagine that the commands for a 2nd hotkey that sets the directory in an active window to the folder one level higher would be the similar, right?

any tips, hints or ideas
thx in advance
GEV
Posts: 1002
Joined: 25 Feb 2014, 00:50

Re: how can i change the folder in an in/active window via hotkey  Topic is solved

18 Nov 2016, 12:19

Sarusei wrote:but what comes next?
how can i change the directory to show me another one(subdirectory in this case "c:\newF\one") in the Active window
Navigating to a directory without opening a new window:

Code: Select all

NavRun("C:\newF\one")

 ; http://msdn.microsoft.com/en-us/library/bb774094
GetActiveExplorer() {
    static objShell := ComObjCreate("Shell.Application")
    WinHWND := WinActive("A")    ; Active window
    for Item in objShell.Windows
        if (Item.HWND = WinHWND)
            return Item        ; Return active window object
    return -1    ; No explorer windows match active window
}

NavRun(Path) {
    if (-1 != objIE := GetActiveExplorer())
        objIE.Navigate(Path)
    else
        Run, % Path
}
https://autohotkey.com/board/topic/1021 ... ntry634365

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: doodles333, Frogrammer and 257 guests