I've just upgraded to the 20090413 version of FolderMenu.ahk (thanks Rexx for adding support for Emacs, FreeCommander and Rxvt).
I found that the FreeCommander support was only intermittently working - sometimes the current directory didn't change. It seems a bit bizarre but I found that calling ControlSetText twice seems to fix it (not sure why, perhaps there's a timing issue):
Code:
else if w_Class = TfcForm
{
Send, !g
;ControlClick, TfcPathEdit1, ahk_id %w_WinID%
ControlSetText, TfcPathEdit1, %f_OpenFavPath%, ahk_id %w_WinID%
ControlSetText, TfcPathEdit1, %f_OpenFavPath%, ahk_id %w_WinID%
ControlSend, TfcPathEdit1, {Enter}, ahk_id %w_WinID%
}
I've also added support for Console2, which I use at work as an alternative to Rxvt (it provides tabs for multiple command windows, supporting cmd.exe, (Cygwin) zsh, powershell.exe, etc.
Here's the update to f_DisplayMenu:
Code:
; Command Prompt, Emacs, FreeCommander, Console2
if w_Class in ConsoleWindowClass,Emacs,TfcForm,Console_2_Main
{
w_Edit1Pos = 1
Menu, MainMenu, show
return
}
.. and the update to f_OpenFavorite:
Code:
else if w_Class = Console_2_Main
{
WinActivate, ahk_id %w_WinID%
SendMode,Play
; SetKeyDelay, 0 ; This will be in effect only for the duration of this Thread.
Send, cd `'%f_OpenFavPath%`'{Enter}
Send, ls{Enter}
}
Note, I had to use `SendMode,Play' because if I use `SetKeyDelay, 0' and try to open a folder with an underscore in its name the underscore gets replaced by a dash (-) and the `cd' obviously then fails. I guess it's a timing-related issue because if I use `SetKeyDelay, 1' it avoids the problem but then it's too slow. I had exactly the same problem when I added Console2 support to Savage's version and used `SendMode,Play' for that too.
I've also made a one-line change in f_OpenFavorite to 'run' items that are not folders:
if !FileExist(f_OpenFavPath) || !InStr(FileExist(f_OpenFavPath), "D") ; file doesn't exist or is not a folder, run it
I've noticed that if I configure a UNC path as a favorite folder it doesn't open. I haven't had chance to look into this yet, but possibly a bug assuming UNC is supported?
I've also tweaked f_DisplayMenu to allow Hotkey1 to work (just open the folder) even for apps that are not explicitly supported, as I like to be able to press the hotkey anywhere and have it just open the folder as best it can. I realize I could use hotkey2 but I have that as a mouse binding and I often just prefer to use the keyboard

. Not sure if this behaviour should be a user option?
I just commented out these lines in f_DisplayMenu:
Code:
; return if not supported
;if w_Class not in %f_SupportApps%
; if w_Class not contains %f_SupportAppsC%
; return
.. and changed the end of f_DisplayMenu:
Code:
; Else just display menu
; Clear the w_Edit1Pos to do the default action
w_WinID =
w_Class =
w_Edit1Pos =
Menu, MainMenu, show
return