Well if all you want to do is use the script's "open path in various things" functionality you can just use this function. I just pulled the relevant bits out of the script and mashed them together but it seems to work right. (It's evolved a lot since I first wrote it

)
Code:
OpenPath( target )
{
WinGet, f_window_id, ID, A
WinGet, f_window_min, MinMax
If ( f_window_min == -1 ) ; Only detect windows not Minimized.
f_window_id =
WinGetClass, f_class, ahk_id %f_window_id%
If f_class in #32770,ExploreWClass,CabinetWClass,dopus.lister ; Dialog or Explorer.
ControlGetPos, f_Edit1Pos,,,, Edit1, ahk_id %f_window_id%
If f_AlwaysShowMenu = n ; The Menu should be shown only selectively.
{
If f_class in #32770,ExploreWClass,CabinetWClass ; Dialog or Explorer.
{
If f_Edit1Pos = ; The Control doesn't Exist, so don't display the Menu
Return
}
Else If f_class <> ConsoleWindowClass
{
IfNotInString, f_class, bosa_sdm_ ; Microsoft Office application
Return ; Since it's some other window type, don't display Menu.
}
}
; It's a dialog.
If f_class = #32770
{
If f_Edit1Pos <> ; And it has an Edit1 Control.
{
; Activate the window so that if the user is middle-clicking
; outside the dialog, subsequent clicks will also work:
WinActivate ahk_id %f_window_id%
; Retrieve any filename that might already be in the field so
; that it can be restored after the switch to the new folder:
ControlGetText, text, Edit1, ahk_id %f_window_id%
ControlSetText, Edit1, %target%, ahk_id %f_window_id%
ControlSend, Edit1, {Enter}, ahk_id %f_window_id%
Sleep, 100 ; It needs extra time on some dialogs or in some cases.
ControlSetText, Edit1, %text%, ahk_id %f_window_id%
Return
}
; else fall through to the bottom of the subroutine to take standard action.
}
; In Explorer, switch folders.
Else If f_class in ExploreWClass,CabinetWClass,dopus.lister
{
If f_Edit1Pos <> ; And it has an Edit1 Control.
{
ControlSetText, Edit1, %target%, ahk_id %f_window_id%
; Tekl reported the following: "If I want to change to Folder L:\folder
; then the addressbar shows http://www.L:\folder.com. To solve this,
; I added a {right} before {Enter}":
ControlSend, Edit1, {Right}{Enter}, ahk_id %f_window_id%
Return
}
; else fall through to the bottom of the subroutine to take standard action.
}
; Microsoft Office application
Else IfInString, f_class, bosa_sdm_
{
; Activate the window so that if the user is middle-clicking
; outside the dialog, subsequent clicks will also work:
WinActivate ahk_id %f_window_id%
; Retrieve any file name that might already be in the File name
; control, so that it can be restored after the switch to the new
; folder.
ControlGetText, text, RichEdit20W2, ahk_id %f_window_id%
ControlClick, RichEdit20W2, ahk_id %f_window_id%
ControlSetText, RichEdit20W2, %target%, ahk_id %f_window_id%
ControlSend, RichEdit20W2, {Enter}, ahk_id %f_window_id%
Sleep, 100 ; It needs extra time on some dialogs or in some case
ControlSetText, RichEdit20W2, %text%, ahk_id %f_window_id%
Return
}
; In a console window, CD to that directory
Else If f_class in ConsoleWindowClass,Console Main Command Window
{
WinActivate, ahk_id %f_window_id% ; Because sometimes the mClick deactivates it.
SetKeyDelay, 1 ; This will be in effect only for the duration of this ThRead.
IfInString, target, : ; It Contains a Drive letter
{
StringLeft, target_Drive, target, 1
Send %target_Drive%:{Enter}
}
Send, cd %target%{Enter}
Return
}
; Since the above didn't return, one of the following is true:
; 1) It's an unsupported window type but f_AlwaysShowMenu is y (yes).
; 2) It's a supported type but it lacks an Edit1 control to facilitate the custom
; action, so instead do the default action below.
Run, %target%,, UseErrorLevel
StringUpper, tmp, ErrorLevel
If ( tmp == "ERROR" )
MsgBox, 4096, Error, Could not open: %target%, 30
Return
}
And you can use it simply:
Code:
F12::OpenPath( "C:\Command\Work" )
Enjoy!