Jump to content

Hot Folders


WideBoyDixon
 Share

Recommended Posts

V0.4.0

Quite a few changes to this now. Here's what I remember that I've done:

  • Made the application localizable by using an INI file based on the current user's LCID. If it's not there then you'll get the English strings which you can then change by editing the HFxxxx.INI file that gets created.
  • Removed the keyboard hook as it was conflicting with the hotkey setting.
  • Added the ability to configure the hotkeys used for the application functionality.
  • Added an about tab for shameless self-promotion :-)
  • The dialog is created and destroyed on the fly rather than being permanently created. I've also used Koda to design it (now that I've got the hang!)
  • Fixed the problem with the address bar not being displayed in Windows Explorer
  • Added "Special" folders to the shortcut menu
  • Split this into multiple scripts with a view to re-using some functionality in other projects. You need to load up _HotFolders_v0.4.0.au3.
The updated ZIP file is attached and is much smaller as I've removed some image formats from the icon file.

------------------------------

V0.3.0

Seems like AutoIt scripts are addictive! I've added an option for a shortcut menu on file open/save dialogs. Pressing [Ctrl]- will bring up a menu with a list of "Active" and "Hot" folders. "Active" folders are ones currently open in an explorer window. "Hot" folders are the ones configured in the dialog. I'm considering adding an application specific history to this menu as well but I'm not sure whether it will be useful. There's also an option to remove the current filter by forcing "*.*" into the selection. Description below updated.

Thanks to Ascend4nt and lod3n for the _WinAPI_ProcessGetFilename UDF.

Thanks to happy2help for updating the UI.

------------------------------

V0.2.0

Suggestions from happy2help included. There's now a menu for the folders on the tray icon. Also, the first available item in the list is selected when the dialog is created.

------------------------------

I used to use a tool called Dirkey NTXP to provide fast access to commonly used folders. However, the program is no longer maintained and it doesn't support everything I'd like it to. The only other tool that comes near right now is FlashFolders but this installs itself as a service which makes me jumpy and it still doesn't provide everything I'd like. To this end, I present my very first complete script called "Hot Folders". A quick user guide:

Use [Ctrl][Win]- to bring up the settings dialog. From here you can:

  • Select an item in the list using the mouse or a numeric key 0-9.
  • Double click an item or use the "Browse" button to change the associated folder.
  • Use the "Clear" button to remove the association for a number.
  • Click "Explore" to run Windows Explorer for the currently selected folder.
  • Choose whether Windows Explorer will open with the folders shown on the left (or not).
  • Click "Close" to minimise the dialog to the system tray.
In use, you use [Ctrl][Win] and a numeric key (0-9) to quickly switch to the associated folder from the settings dialog. The exact behaviour of this key combination depends on the currently active window. Supported windows are:

  • The Windows built-in common file open/save dialog
  • The MS Office file open/save dialogs
  • The Visual Studio 2005/2008 file open/save dialogs
  • Windows Explorer
For 1 to 3 the hotkey will change the currently active folder for the dialog. For 4 it will browse to the associated folder. If the currently active window is not a supported type then the key combination will open a Windows Explorer window with the associated folder selected.

You can also use [Ctrl]- when the currently active dialog is a file open/save dialog. This will create a shortcut menu from which you can select one of your configured folders or any folder currently open in a Windows Explorer menu. In addition, you can select the installation folder for the current application. The shortcut menu also includes an option to remove the active filter from the dialog by forcing "*.*" into the file selection.

I was going to continue development of this script to allow more configuration options (e.g. which hotkey combinations to use) and to support more active window types but to be honest it does everything that I want it to right now. I've scoured the forum and couldn't find anything similar so I hope that this will be useful to someone. Suggest enhancements would be to

  • Provide support for e.g. Total Commander, Q-Dir etc.
  • Allow configuration of hotkey combination
  • Add in support for the common folder browser dialog (this is detected in the script but isn't handled)
This is my first proper script posting so I hope that I've done everything right. I'd appreciate if you let me know what you think as I have a couple more scripts in the pipeline that I'm working on.

Thanks

WBD

Code now moved to HERE

Edited by WideBoyDixon
Link to comment
Share on other sites

I'd appreciate if you let me know what you think as I have a couple more scripts in the pipeline that I'm working on.

Or not I guess. :)

Link to comment
Share on other sites

Or not I guess. :)

This is a great script. I shoved my favorite 10 folders in and i am using it right now!

Any possibility of a menu of your folders when you left-click on the icon? Would be much easier to use when your desktop is full of windows!

When you bring up the settings dialog it would be good for it to select the next empty selection. When i first used it i couldn't figure out why the "explore" button didn't work. (you need to click on one first)

Link to comment
Share on other sites

This is a great script. I shoved my favorite 10 folders in and i am using it right now!

Thanks!

Any possibility of a menu of your folders when you left-click on the icon? Would be much easier to use when your desktop is full of windows!

Done.

When you bring up the settings dialog it would be good for it to select the next empty selection.

Done.

Thanks for the feedback.

WBD

Link to comment
Share on other sites

It's now even better!! I had done some tweaking last night before you posted your update and think it will make it better. It's only cosmetic, but looks better. here is the code i changed (only the numbers)

#Region SETTINGS_DIALOG
Opt("GUIOnEventMode", 1); Trigger events for dialog-based actions
; Create the settings dialog
$SettingGUI = GUICreate("Hot Folders", 524, 300); Main settings dialog
GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseGUI"); Capture form closing event
$FolderListView = GUICtrlCreateListView("#|Folder", 8, 8, 507, 219, 13); The main list view
GUICtrlSendMsg($FolderListView, 0x101E, 0, 50); Column 1 = 50 wide
GUICtrlSendMsg($FolderListView, 0x101E, 1, 400); Column 2 = 400 wide
_GUICtrlListView_SetUnicodeFormat($FolderListView, True); Use Unicode in the listview

; Add in the folders we read from the INI file
Dim $i, $bSetItem = True
For $i = 0 To 9
    GUICtrlCreateListViewItem($i & "|" & $aFolders[$i], $FolderListView)
    If $bSetItem And ($aFolders[$i] = "") Then
        _GUICtrlListView_SetItemSelected($FolderListView, $i)
        $bSetItem = False
    EndIf
Next
If $bSetItem Then _GUICtrlListView_SetItemSelected($FolderListView, 0)

; Create the buttons and set the handlers
$FoldersCheckbox = GUICtrlCreateCheckbox("Explorer window shows &folders", 8, 234, 507, 25)
GUICtrlSetOnEvent($FoldersCheckbox, "_ChangeFolderDisplay")
GUICtrlSetState($FoldersCheckbox, $sShowFolders)
GUICtrlCreateButton("&Browse", 8, 266, 81, 25, 0)
GUICtrlSetOnEvent(-1, "_BrowseForFolder")
GUICtrlCreateButton("&Clear", 96, 266, 81, 25, 0)
GUICtrlSetOnEvent(-1, "_ClearFolder")
GUICtrlCreateButton("&Explore", 184, 266, 81, 25, 0)
GUICtrlSetOnEvent(-1, "_ExploreFolder")
GUICtrlCreateButton("Close", 384, 266, 81, 25, 0)
GUICtrlSetOnEvent(-1, "_CloseGUI")
GUIRegisterMsg($WM_NOTIFY, "_OnNotify"); Capture notify events
GUISetState(@SW_HIDE); Hide the main dialog
#EndRegion

This just allows everything to be displayed without the sliding bars being there.

Link to comment
Share on other sites

V0.3.0 Now available. Please see the original post for updates. Of course, I'm really hoping to attract a comment from one of the revered AutoIt "gurus" :)

Regards,

WBD

Edited by WideBoyDixon
Link to comment
Share on other sites

V0.3.0 Now available. Please see the original post for updates. Of course, I'm really hoping to attract a comment from one of the revered AutoIt "gurus" :)

Regards,

WBD

Is V0.3.0 in the codebox?

I don't see a link to the download like you have for V0.1.0 & V0.2.0 ...

Link to comment
Share on other sites

Is V0.3.0 in the codebox?

I don't see a link to the download like you have for V0.1.0 & V0.2.0 ...

Ditto!!!

You asked for a guru and ResNullius showed-up. At least have a version or about or some manor of info inside the script for version if you are telling others there is a version difference.

Valuater

8)

NEWHeader1.png

Link to comment
Share on other sites

Is V0.3.0 in the codebox?

Yes it was but it was too large to edit (wouldn't work in IE or Firefox) so I've replaced it with a ZIP now. There I was waiting for expert opinion and two turned up (like buses?). Dangnabbit!
Link to comment
Share on other sites

V0.3.0 Now available. Please see the original post for updates. Of course, I'm really hoping to attract a comment from one of the revered AutoIt "gurus" :)

Regards,

WBD

Don't know if the revered or guru status applies but I'll throw in my two cents worth anyway...

So far so good.

My favorite feature is the usage in the File Open/Save Dialogs.

Most of my regular file management/navigation duties are carried out using a console based dual-pane file manager, but this could definitely be a help when saving scripts from SciTE to the various category folders & sub-folders I've set up.

One thing I have noticed with Explorer though: if I have it open and then hide the address bar, the hotkey switching will work until I close Explorer then reopen it. Then the hotkeys no longer work unless I show the address bar again. I haven't really looked at your code to see how its handling the Explorer windows, but if it is dependent on the Address bar being visible, then you should add a check to see if it is, and if it isn't then add a prompt to display it when a user activates a hotkey combo in Explorer and/or a preference in your settings to "always display explorer address bar if not visible".

Like I said, my two cents worth, do I get any change back? :)

Edit: This testing was done on Windows 2000.

Edited by ResNullius
Link to comment
Share on other sites

Good point well made! I was assuming the address bar was visible and forgot to even consider that this might not be the case. I've added something in to ensure that it's visible but it will only work on an English OS since it sends [Alt]V[Alt]T[Alt]A to toggle the visibility of the address bar. I'd like to be able to implement CWM_SETPATH but my preferred way of getting a PIDL from a path string is apparently deprecated. Does anyone have code to set the current path for an Explorer window?

WBD

Link to comment
Share on other sites

V0.4.0 now available. See the original post for details. This is getting out of control so I may just resort to bug fixing from now on :-)

Comments, as always, are welcome.

Regards,

WBD

Link to comment
Share on other sites

  • 6 months later...
  • 2 weeks later...

I agree with Yashied..

In the next version you should apply with hotkeys(F1,F2..)

because too much too pressed. I like using hotkeys for fast access.---> Just a suggestion :D

BTW,

Very nice script.

I appreciate it.

[font="Palatino Linotype"][size="2"]*** The information contained in this post should be considered and certified WORKS ON MY MACHINE ***[/size][/font][font="Palatino Linotype"][size="2"] [/size][/font]
Link to comment
Share on other sites

An easy enhancement would be to set the flag in FileSelectFolder() so that the input line is available. I really hate navigating using that MS BrowseForFolder object. At least if the input line is there, you can "copy as path" from an explorer window or get the path from the address bar and just paste it in.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...