Share

Next folder, previous folder navigation in Explorer with QTTabBar

QTTabBar surprised us with the update recently, after almost three years of silence. (The changelog also points to an importance of having a full copy of your code somewhere outside of your PC. Version control systems to the rescue.)

To celebrate this fact, I decided to publish a little custom feature I’m using with QTTabBar — a script and UI buttons to navigate between folders within one common parent folder.

There are cases when you need to visit a set of folders, and goind up and down in the folder structure is getting tedious. That’s where magic “Next folder”, “Previous folder” buttons come in handy.

Navigation pane, a.k.a. tree view can, in principle, be used for that, but it isn’t always convenient to use. I can only use it for top level navigation, unless Microsoft will come up with some way to reduce clutter in the tree - not showing subfolders that aren’t ascentants or descendants of current folder for example.

My QTTabBar panel looks like this:

QTTabBar panel screenshot

Two triangles looking in opposite directions are the buttons this post is dedicated to.

Below is the code and description for the buttons.


How to install

(assuming you have QTTabBar already):

  1. download zipped files from the gist page;
  2. find a place to unzip and store them;
  3. update both .QTTabBarCommand files to include the right path to the script file1;
  4. just drag them onto QTTabBar panel.

1 Or you can skip the third step and edit buttons after adding them, through button context menu.

Here is embedded gist, because why not (downloading archive from the gist page still simpler, though):

click to showhide
click to showhide

How it works

The script uses QTTabBar’s scripting API.

It looks into parent folder from the current location, looks for next (or previous) accessible folder and navigates there. It also works with drives if you’re in the root of any drive.

I left hidden folders accessible, but made system folders ignored. This can be changed through commenting/uncommenting corresponding lines.

Navigation is looped, so next to the last folder comes the first one. And prior to the first folder comes the last one.

Ordering of folders is alphanumeric. This means “Folder10” comes between “Folder1” and “Folder2”. This or this are probably the fullest reference we can get on the matter, and yet it has no mention of sorting order. Order of items in collections isn’t guaranteed, but seems to be reliable as long as we have no need to modify the collection.

comments powered by Disqus