EZFF prototypes several functions that I always wanted in ZTree,
based on what I implemented about a decade ago in my OpenVMS file manager
and find hard to live without. I now have them. I hope some flavor
of what it offers will make it into ZTree and EZFF will become obsolete fast :-)
Why EZFF?
ZTree file filtering, as described in section "1.4 FILE Specification Box"
of ZTW.HLP, currently handles three types of file properties:
Making full use of ZTree's powerful filtering feature is very hard in practice,
even with clever use of Filespec's history and macros.
There are simply too many permutations to store, bookmark and pick
from, let alone type in. The result is that the user most of
the time sees more files than needed, requiring visual selection
and tedious Filespec fine-tuning. Likewise, most users probably
never venture into constructing complex filters and tapping into
the full power of ZTree's file filtering. In a word: Filespec filtering
is underutilized because it requires too much work.
EZspec definition
The EZFF puts a wrapper around the Filespec interface that
allows modifying the three filters independently, but acting
as a unified triple filter or "EZspec":
By packaging the Date and Size filters as cycles of commonly used values (which the
user can customize in the script source), arriving at the right combined filter becomes
very easy, despite the possibly large number of permutations.
The NameSpec feature also simplifies the boring task of inserting
wildcards manually giving the user a chance to use the characters
making up a file name more intuitively. Most of the time, 3 or 4
characters suffice to select a set of wanted files without thinking
about wildcards or spelling at all. By making the '*' implicit,
searching becomes much faster and more interesting.
My annoyance with typing '*' was what motivated me to write EZFF; I now
rarely use the standard ZTree Filespec syntax. Think of it as "googling"
your file list and then tuning your hits as needed. But, as with web search hits,
where we almost always find what we need near the top of the first page,
EZFF hits are highly accurate.
This has to be tried for a while to be fully appreciated, and
changing certain mental habits will also help.
Safe mode
For more efficiency (or amusement), in "Safe" mode, the newly defined hotkeys
will work anywhere in ZTree (F9, Viewer, dialogs, histories), not only in FW or DW.
In fact, the user need not invoke (or think in terms of) the Filespec command at all!
The Safe mode trade off is that if you are in the B/S/G view, it will be
reset to the File Window by default. This is so because EZFF has no idea
what the current ZTree context is and, to play safe, always sends three ESC
characters and Enter to make sure ZTree is in the File Window.
Safe mode can be toggled on/off with a single key.
Installation
After downloading and expanding the ZIP file,
place EZFF files in your tools area (or in #ZThome) and launch EZFF.EXE
in any way you want. You need a single instance of EZFF running,
regardless of the number of ZTree instances.
If you want to experiment with the source version (four .AHK files), you
must first obtain and install AutoHotkey.
When loaded into the AutoHotkey interpreter (or executed), this script's presence
will be revealed by a large "H" on a green background in the Systray, where it
will just sit and wait.
When a ZTree instance comes into focus (becomes the foremost window on the desktop),
EZFF will start interacting with its keyboard handling in a way that is transparent
to the user. This is achieved by looking for the "ZTreeWin" string in the titles
of all active windows. For this string to appear in its window title, ZTree must
be started with the /ZT command line switch. If not, EZFF will not be able to find
and interact with ZTree instances.
The interaction between EZFF and ZTree is as follows: certain keycodes (described later)
are trapped (not passed to ZTree) and processed by EZFF.
The script then builds a string and sends it to the ZTree input stream, as
if typed on the keyboard. This is similar to the ZTree macro mechanism
(F12), except that this time the strings are arriving from an external
program.
EZFF simply sits and waits for subsequent keyboard input, ignoring all keycodes
except those described below. Like many similar tools, EZFF can be terminated
by right-clicking on the "H" icon in Systray and selecting "Exit".
There may also be options to Pause, Suspend, Reload, or Edit the script, all of which
are useful for script developers but not needed for general use.
Keycodes processed by EZFF
Each time one of the hotkeys listed below is struck, EZFF sends a string to ZTree's Filespec dialog (along with some control data):
Ctrl+,
instructs EZFF to send ZTree file selection commands 1-8 in
circular fashion. For example, hitting this key for the very first time will
send spec #1 ("f=TODAY"); spec #5 will send "f>=2007-01-01,<=2007-12-31" (current year), etc.
This is much more convenient than maintaining a Filespec history of date
selection criteria, which, except for the "TODAY" token, requires modification
the moment a month or a year changes. It would thus make a lot of sense
for Filespec to recognize tokens like "HOUR", "YESTERDAY", "WEEK", "MONTH", "YEAR",
and possibly some others.
Note that ZTree CO1K must be set to the yyyy-mm-dd format,
because
Ctrl+,
is programmed to send DateSpecs in this format.
I personally find this format unambiguous and the most logical and
use it consistently wherever available.
Note that EZFF was not tested with any other date format.
The week selection assumes the week starts on Monday at 00:00, coinciding
with the notion of "working week" in most cultures. So, spec #3 will quickly reveal
all the modified files since last Monday; the list should grow longer
as we approach Friday and then drop to no files at all Sunday at midnight.
DateSpec strings change automatically as dates change. Many applications
(Outlook, web browser site visit histories, etc.) use the familiar calendar concept
to group objects; ZTree now has this as well.
Ctrl+.
instructs EZFF to send ZTree commands 1-6 in circular fashion. For example,
hitting this key for the first time will send spec #1 to ZTree ("f>=s0,<s1000");
spec #5 will send "f>=s1000000" (all files equal to or larger than a megabyte), etc.
Unlike dynamic DateSpec values, the SizeSpec values are hard-coded in the script and
can be modified by the user as desired.
Examples of generated EZspecs
EZspecs are designed purely for fast interactive use. If you need to
stop and think, or type in more than 5-6 characters, you might as well
use the standard Filespec dialog -- you are not ready yet :-).
Warning: EZspecs can return surprising and unpredicatable hits,
so it may not be wise to use them in macros (if you find a way of doing it)!
Getting rid of EZspecs
To quickly abandon EZspecs set by the three hotkeys and revert to the
*.* default, just use the familiar f,Enter sequence! Remember, all
ZTree keys are always available when EZFF is running, even with the
Debug popup enabled.
Note that if you then go back to hitting
Ctrl+, and
Ctrl+.,
the cycles will continue exactly where they stopped. Cycles have no idea what
ZTree session you are in and what is going on in it; they just keep sending
their strings in a regular, circular fashion to whomever is there to receive them.
Your f,Enter sequence thus did not impact the current EZspec in any way.
To reset all the three filters (or any one of them) that make up
the EZspec, use the three reset hotkeys listed above, which are, conveniently,
the shifted keys of the filter-generating hotkeys.
Technical details and issues
EZFF faces the delicate problem of knowing which state ZTree is in,
that is, is the Filespec: prompt available.
This can be solved reasonably well by parsing ZTree's title
bar or the ZAAP zbar.dat file. This file knows a lot about the current
ZTree state, but parsing it before sending each command is quite costly.
For more advanced scripts, this may be the only way to go, but
EZFF can be more relaxed. The user may even disable the "Safe" mode with
Ctrl+6
and simply make sure visually that ZTree is in FW or DW, both of which
accept the Filespec command.
There are no known conflicts with the ZTree UI, since none of the above
hotkeys are being used officially. But there is a small possibility for conflict
if the user is in a history list *and* there are bookmarks using numbers 0,
1, 6, 7, 8, or 9. If any of the EZFF toggle hotkeys (Ctrl+%) is hit, it will
be processed by EZFF, and not fetch the bookmarked history item as expected.
Unlike a ZAAP exectuable, there is no need for the /ZB switch
and the issues related to writing to a disk file are avoided.
No other programs are impacted by EZFF's hotkeys, not even
ZTW_CFG.EXE. Technically, EZFF works only in a window that belongs
to the ConsoleWindowClass class and whose title starts
with the "ZTreeWin" string. Therefore, EZFF could also easily interact
with ZTW_CFG.EXE by attaching itself to a console window with "ZTW.INI"
in the title.
EZFF leaves no traces in the Filespec history, or anywhere else.
However, ZTree puts all Filespec input into the history by default,
so there is a slight overhead caused when EZFF removes these
entries. This problem would go away if ZTree had an option to inhibit
the history mechanism on a per-command basis -- when it's terminated
with Ctrl+Enter, for example.
At launch time, EZFF actually writes a temporary file to the
disk and deletes it immediately. It sends ZTree this string:
{Esc}{Esc}{Esc}xSET #ZThome>%TEMP%\ezff.tmp{Enter}{Esc}
allowing EZFF to find out where #ZThome is pointing to by
parsing ezff.tmp. A more elegant way of doing it that will eventually
be implemented.
It is important to note that each EZFF hotkey only impacts the
part of the EZspec that it is in charge of. For example,
the date-cycling part will not impact the size-cycling
part of the EZspec, permitting a cumulative action of the two cycles.
This means that with just these two hotkeys, 7x5=35 combinations
of date/size selections are possible. This flexibility is simply
just not practical using the standard Filespec mechanism.
To eliminate the need to hit Enter, or, worse, navigate to some
directory while using the cycle hotkeys, set ZTree option CO2Q to Remain
and CO2R to No. This will make cycles insensitive
to cases where there are no hits in the current view, especially
the S/G/B view. You will simply see the "No files match the filespec"
message but not lose the DW or FW context.
Power use
The number of hotkeys defined by EZFF seem overwhelming
at first, but once you configure EZFF the way you like
it, all you will be using 95% of the time will be the cluster
made up of these three filtering hotkeys:
Ctrl+,
Ctrl+.
Ctrl+/
(Ctrl+COMMA Ctrl+DOT Ctrl+SLASH)
Occasionally, you may want to reset one or more filters
by simply shifting the preceding hotkeys, resulting in:
Ctrl+<
Ctrl+> and
Ctrl+?.
The reset hotkeys simply jump to the end of the cycle, so their
action is already present in the three central EZFF hotkeys. This means
that you don't even need to remember them but simply keep cycling until
you reach the reset value.
A useful hotkey to remember is
Ctrl+1, to copy
the current EZspec into ZTree's native Filespec prompt for further manipulation.
Disclaimer
The EZFF executable and sources are free for anybody to use
and modify at their own risk.
Download ezff.zip
The EZFF About popup
will then be splashed. It can be closed fast with Enter, but it's recommended to
select Help and other options at least once. The About popup can be brought back
at any time with Ctrl+F10 while in ZTree, in case you want to check for
ZTree, AutoHotkey or EZFF updates, for example.
Since I used all of these tools frequently when developing EZFF, I found it practical
to reach their respective sites instantly this way.
After that, the Debug popup will appear and float annoyingly
on top of ZTree and all other windows! It is therefore recommened to learn the
basic hotkeys immediately and toggle this window on/off as needed using Ctrl+0.
After you learn the hotkeys that you plan to use, you will forget both of these popups
and forget that EZFF exists. It was designed to integrate into ZTree as seamlessly
as possible.
if any, are also included in display #6, because, by definition,
their "illegal" dates are outside the scope of the current year. Such files are
rare, but don't be surprised to find them on your disks, and don't
hesitate to use them creatively :-).
Note that here you can unload the script from memory by hitting "Unload", which is faster than
mousing around with icons in the Systray. You may also reload the script, if the "Reload"
button is available.
Ctrl+/.hlEnter
*.*h*l*
Note that ".ht" or ".hm" would also work, but not ".tm", since it would also match *.TMP files.
Ctrl+/..Enter
*.*.*
Ctrl+/.xeEnter
plus some cycling with CTRL+,
*.*x*e*,>=TODAY-4,<=TODAY
Note that ".x" would also show *.TXT files, so ".ex" or ".xe" is needed,
but the days of typing "*.exe" are over! Over time, you will find the magic
minimum to type for perfect hits.
Ctrl+//z/t16Enter
plus some cycling with CTRL+,
and CTRL+.
zt*1*6*,>=2007-01-01,<=2007-12-31,>=s10000,<s100000
Note the special operator '/' which tells EZFF to not insert '*'
in the specified position. This is needed rarely, but is very handy for tuning a
name filter. In this case we want all files that start with "zt".
Ctrl+/ag1/9/9./d/oEnter
*a*g*199*.do*
If consistent file naming is enforced, the above should select all files
named "August 1996 report.Doc", "Draft, aug 1997.DOC_SAVE", or "Avg 1991 data.DOC".
The risk is that this file with a typo will not be included in the list: "August 19095.DOC",
because we explicitly wanted the characters "199" to be adjacent.
Ctrl+/.jpEnter
*.*j*p*,<2007-01-01,>2007-12-31,>=s1000,<s10000
Note that just ".j" would work perfectly on a collection of media files
consisting of .JPG, .PGN, .BMP, .TIF, etc. Knowing what types of files
you are working on can help you reduce the number of needed characters.
Thus, ".pg", exapnded to "*.*p*g*" by EZFF, will select both .JPG and .PGN;
you don't have to worry about selecting *.PROG or *.page, because you
know your context very well.
Tests were done only on Windows XP/SP2/SP3.
Only the US keyboard was tested, so the central EZFF hotkeys
may not be clustered conveniently on other keyboards.
Copyright 2007-2012 vujnovic@free.fr. All rights reserved.
Updated: 20120324