NiftyLink – Versatile links for Explorer and Total Commander
Version 1.10
Freeware
© Jürgen Lüthje 2012
Contents
Description
Installation in Total Commander
Creation of NiftyLinks
Execution of NiftyLinks
Settings in the INI file
Translation
Credits
License
Contact
Description
NiftyLink is a 32 bit program
for Windows 2000/XP/Vista/7, that integrates with Windows Explorer, and
provides additional functionality as portable add-on for
Total Commander (version 7.50+). It allows creation and execution
of special links to directories, files, and internet addresses. These
links provide possibilities, that are not given with any standard Windows
link (LNK file, junction, symbolic link, or hard link).
General
-
NiftyLinks to directories and files can contain absolute paths
or relative ones. Relative links are portable
and work even on USB drives and e.g. inside of a Dropbox.
-
Absolute paths can contain volume names instead of drive letters.
This is especially useful for USB drives, because their drive letters can change.
-
NiftyLinks can contain environment variables and pseudo environment
variables (like in Total Commander). The program itself provides the
two environment variables %nifty_drive%
and %nifty_path%.
-
NiftyLinks can contain self-defined shortcuts.
-
NiftyLinks to certain documents can point directly to a
specific "page". The word "page" must not
be taken literally: It can also be e.g. a slide of a presentation, or
a record in a database. The only prerequisites are, that the
corresponding program provides a function for this, and that the proper
simulated keystrokes are given in the INI file.
When you have a complete book in the form of a PDF file (not seldom
these days), then you can e.g. create links to particular chapters or
as bookmarks. This even works with protected PDF files.
-
When you press the [Shift] key while double-clicking at a NiftyLink,
then not the target file or the target directory will be opened,
but its parent directory (in Total Commander in the current tab), and
the target will be selected. Then you can rename, copy,
delete or do other things with the target.
(With a NiftyLink to an internet address, this is of course not possible.)
-
NiftyLinks are small files that consist of plain text.
-
NiftyLinks work on any file system (FAT, NTFS) that is supported by
Windows.
Additional features in Total Commander
-
Extended dialog for creation of NiftyLinks.
-
NiftyLinks to directories and archives can open them in the current
tab or in a new tab – in the current or in the other panel of
Total Commander.
-
NiftyLinks are aware of installed packers and Total
Commander's internal associations.
-
NiftyLinks can point to directories that are provided by filesystem
plugins.
-
With the content plugin "Text Line", the content of
NiftyLinks can be displayed as tooltip.
Installation in Total Commander
a) For creating NiftyLinks
Create an entry like the following in Total Commander's button bar or
in its start menu (paths to files must be adapted).
Command : %commander_path%\..\NiftyLink\NiftyLink.exe
Parameters: %P%N
Start path:
Icon file : %commander_path%\..\NiftyLink\NiftyLink.exe
Tooltip : Create NiftyLink in target directory
b) For executing NiftyLinks
Create internal associations in Total Commander with the program
NiftyLink.exe for each file type
*._x (NiftyLink to a directory) and
*.fx (NiftyLink to a file). Associate both file
types with the following command for opening (adapt path):
"%commander_path%\..\NiftyLink\NiftyLink.exe" /e "%1"
The advantage of creating separate associations for each file type is,
that this way different icons can be associated with them. The program
NiftyLink.exe contains icons for this purpose.
c) For showing the content as tooltip (if wanted)
Unfortunately, special characters such as the German
umlauts are not displayed correctly.
-
Download the content plugin
"Text Line",
and install it by double-clicking at the ZIP file inside of Total
Commander.
-
Go to the subdirectory of Total Commander, to which the
"Text Line" plugin has been installed. Open the file
"TextLine.ini" with an editor, and in the
[Options] section, add
_x fx to the list of file
extensions.
-
In the main menu of Total Commander choose
Configuration > Options > Display >
User-defined (the [+] button on the bottom right).
-
Click at [Add...], enter as file type
*._x; *.fx ,
and then click at [OK].
-
In the next dialog window, enter the field(s)
[=textline.2] for displaying the link target, or e.g.
[=textline.2]\n[=textline.3]\n[=textline.4]
for also showing page number and comment, if available.
-
Close all open dialog windows with [OK].
Creation of NiftyLinks
General
-
To create a NiftyLink, drag and drop the target (directory
or file) with the mouse to the program NiftyLink.exe,
to a normal shortcut to the program, or to its entry on Total Commander's
button bar. In Total Commander, when the cursor is on the target, it's also
possible just to click at the program entry in the button bar or start menu.
Then a dialog for creating the NiftyLink will be displayed, which is rather
simple for usage without Total Commander.
-
If the NiftyLink file is to be created on the same drive on which the link
target is located, then instead of an absolute path, the NiftyLink can as
well contain the path relative to the directory in which the NiftyLink
file is located.
-
In an absolute path, instead of the drive letter the respective volume name
can be used (if existing). This can be very helpful for USB drives, since
in contrast to the drive letter, the volume name can't change arbitrarily.
The created link can e.g. look like this:
Target="{Victorinox}:\Documents and Settings\John\My Documents\"
-
Entering a comment and, if applicable, a page is optional.
-
NiftyLinks are plain text files (UTF-8 with BOM), they can be changed with
any editor.
-
There is no dialog for creating NiftyLinks to the internet, currently they
must be written with an editor. The URLs must start with http. They can contain encoded characters, e.g.:
Target=http://luethje.eu/prog/fine%20freeware.htm
NiftyLinks to the internet can not be associated internally in Total Commander.
However, they can contain the path to the program with which they are to be opened,
e.g.
Target=%nifty_drive%\GoogleChromePortable\GoogleChromePortable.exe http://en.wikipedia.org/
(Pseudo) environment variables and shortcuts
-
NiftyLinks can contain pseudo environment variables (like in Total Commander).
These provide a system-independent way to identify special frequently used
directories, which may not have the same name or location on any given system.
The names must be written completely in uppercase:
Name | Typical path |
%$DESKTOP% |
C:\Documents and Settings\username\Desktop |
%$PERSONAL% |
C:\Documents and Settings\username\My Documents |
%$APPDATA% |
C:\Documents and Settings\username\Application Data |
-
This program creates two environment variables:
-
%nifty_drive% contains the letter of the
drive on which the file NiftyLink.exe is
(without trailing backslash), e.g. F:
-
%nifty_path% contains the directory where
the file NiftyLink.exe is (without trailing
backslash).
-
NiftyLinks can also contain any other environment variables, as defined
by the operating system or e.g. by Total Commander.
-
Shortcuts that are defined in the INI file can be
used in NiftyLinks, e.g.:
Target=rfc:2822
Pseudo environment variables and self-defined shortcuts can
only be used in NiftyLinks. Environment variables are also passed to the
process that is launched by a NiftyLink.
Additional features in Total Commander
The dialog offers different options for opening the link target,
according to whether it is a directory, an archive, or a normal file.
-
automatically
is always available. Directories and archives are opened in TC, for
an archive a corresponding packer is searched. For a normal file,
a corresponding command with which it can be opened is searched (for
details see below). The created link can look
e.g. like this:
Target="..\..\My Documents\".
Choosing the appropriate checkbox(es) for opening a directory or archive
in a new tab and/or in the other panel will insert
<newtab>, <other> or
<newtabother>, e.g.:
Target=<other> "..\..\My Documents\".
-
as archive in TC
is meant for archives, that are not treated automatically as such by
NiftyLink (archives that can be opened in
TC with [Ctrl]+[PgDown]). Which archives are exactly concerned depends
besides other things on the installed packer plugins. The created link
can look e.g. like this:
Target=<archive> "..\..\My Documents\info.odt".
Instead of <archive>, also
<newtab>, <other>
or <newtabother> can be used.
-
with this command associated internally in TC
is available for directories, archives and normal files, for which
there is a matching internal association
in TC. If there is more than one matching command, the combobox
allows to choose the desired one. The created link can look e.g.
like this:
Target=<TC_open> "..\..\My Documents\info.odt".
-
with the command associated in the system
is always available, except for EXE, CMD, BAT and COM files. Directories are
opened in Windows Explorer – also archives, if the Explorer can handle them.
It depends on the installed programs how normal files will be opened. The
created link can look e.g. like this:
Target=<system> "..\..\My Documents\info.odt".
-
with this program
is always available. The link target will be opened with the chosen program.
The created link can look e.g. like this:
Target=C:\Programs\Demo\Sample.exe "..\..\My Documents\info.odt".
Execution of NiftyLinks
General
To execute a NiftyLink, select it and press [Enter], or double-click at
it. When you press the [Esc] key at the same time, then the input focus
always stays in the current tab of Total Commander (or in the current
Explorer window), even when the respective NiftyLink opens a directory
or archive in another tab (or in another Window).
When you press the [Shift] key while executing a NiftyLink, then not
the target file or the target directory will be opened, but its parent
directory (in TC always in the current tab), and the target will be selected.
Execution without Total Commander
NiftyLinks can contain special <commands
in angle brackets> for execution in Total Commander.
Without Total Commander, the commands
<archive>, <newtab>,
<other>, <newtabother>
and <system> are simply ignored. Commands that
begin with <TC_ cause an error message, when
executed without Total Commander.
Execution in Total Commander
In certain situations, NiftyLink searches the
currently used file "wincmd.ini" for an appropriate command for
opening the link target (even when the concerning sections of "wincmd.ini"
are redirected to other files).
-
When "automatically" was chosen while creating the NiftyLink,
then a directory is always opened in Total Commander. For a
file, an appropriate command will be searched in the following
order:
-
Highest priority has the search for a corresponding packer (see below).
-
Second priority has the search for a matching internal association
(see below).
-
Lowest Priority has the program, with which the linked file is
associated in the operating system.
-
If in a link target a file name is preceded by
<archive>, <newtab>,
<other> or <newtabother>,
then a corresponding packer is searched. Firstly the section
[Packer] is searched, then the section
[PackerPlugins].
-
If the link target begins with <TC_...>, then the section
[Associations] will be searched for a matching
internal association. Two types of entries are supported:
-
Lists of name patterns.
It is searched for the first pattern, that matches the current file
or directory name, where
* matches any zero or more characters,
? matches any single character.
Lists of different patterns such as
*.ini;*.log *.txt "ab cd.*"
are supported. The patterns are separated by semicolons and/or blanks.
If there is a blank within a pattern, then this pattern
must be enclosed in quotes (like the last pattern in the above list).
The list can also contain the character |,
followed by patterns which should not match the given file or
directory name (like in Total Commander), e.g.
*.* | *.bmp *.jpg *.png
-
So called predefined selection types (as defined in the
section [Searches] of Total Commander's INI file).
After "SearchFor=", there can be a list of name patterns (see
above), or a Regular Expression (PCRE).
If this entry is empty, any name will match. The entry after
"SearchFlags=" defines whether or not the search filter is a
Regular Expression, and whether only files, only directories, or both files
and directories shall match.
"SearchIn=" and "SearchText=" are ignored.
The special commands which are listed in the Total Commander help are
not supported.
Settings in the INI file
The program reads information from an INI file
named "NiftyLink.ini". It firstly looks for this file
in its own directory (important for portable usage). If the file
does not exist there, then it is searched in the directory
%APPDATA%\NiftyLink\, or will be created if
necessary. Lines that start with a semicolon are comments, and will not
be interpreted.
The standard INI file looks like this:
[General]
Language = English
HelpFile = niftylink_en.htm
[Shortcuts]
doi = http://dx.doi.org/%s
pubmed = http://www.ncbi.nlm.nih.gov/pubmed/%s
rfc = http://www.faqs.org/rfcs/rfc%s
ms-kb = http://support.microsoft.com/kb/%s/en-US
amazon = http://www.amazon.de/o/asin/%s
[Go to page]
; Some of the following commands probably only work for the *German* version
; of the respective program.
Adobe Reader = {SHIFTDOWN}{CONTROLDOWN}n{SHIFTUP}{CONTROLUP}||%s{ENTER}
PDF-XChange Viewer = {SHIFTDOWN}{CONTROLDOWN}n{SHIFTUP}{CONTROLUP}||%s{ENTER}
Microsoft Word = {CONTROLDOWN}g{CONTROLUP}||{ALTDOWN}m{ALTUP}s{TAB}%s{ENTER}{ESCAPE}
TextMaker = {CONTROLDOWN}g{CONTROLUP}||{ALTDOWN}g{ALTUP}s{TAB}%s{ENTER}{ESCAPE}
Microsoft PowerPoint = {F5}||%s{ENTER}
PowerPoint Viewer = %s{ENTER}
SoftMaker Presentations = {CONTROLDOWN}g{CONTROLUP}||{HOME}%s{ENTER}
Citavi = {CONTROLDOWN}e{CONTROLUP}#%s{DELAY 150}{ENTER}
a) The language and the help file used
by the program normally are chosen automatically, depending on the language
of the operating system. However, in the first section of the INI file,
you can choose a different language and a different help file. The
corresponding language file must be located in the subdirectory
lang, and the help file must be in the
subdirectory doc.
Note: If this section contains the entry Log = True, then NiftyLink writes
information to a file named "NiftyLink.log" in the same directory,
while executing a link. This information shows especially how NiftyLink searches for a matching internal association
in Total Commander.
b) The second section defines shortcuts which can be used
in NiftyLinks. Before a NiftyLink is executed, %s
will be replaced with the text after the colon. You can add new entries.
(Pseudo) environment variables can be used for
defining shortcuts.
Example:
Given an INI file as above, and a NiftyLink that contains the following line:
Target=ms-kb:294676
When executing this NiftyLink, the address
http://support.microsoft.com/kb/294676/en-US
will be opened.
c) The third section defines simulated keystrokes for
certain programs, so that it's possible to jump directly to a particular
"page" of a file (see above). Entries
for other programs can be added. On the left side of the equal sign, there
must be the name of the program (like it is shown in the title of the window
in which the file is opened). On the right side of the equal sign, there are
the required simulated keystrokes, where %s is
the placeholder for the page number.
Notation for special keys
{ENTER}, {ESCAPE}
{TAB}, {HOME}, {END}, {LEFT}, {RIGHT}, {UP}, {DOWN}, {PAGEUP}, {PAGEDOWN}
{BACKSPACE}, {DELETE}, {INSERT}, {PRINTSCREEN}
{F1}, {F2}, {F3}, {F4}, {F5}, {F6}, {F7}, {F8}, {F9}, {F10}, {F11}, {F12}
{CONTROLDOWN}, {CONTROLUP}
{SHIFTDOWN}, {SHIFTUP}
{ALTDOWN}, {ALTUP}
{DELAY n} (n = number of milliseconds)
When simulated keystrokes are sent to other programs, a proper delay at
the proper moment can be crucial. NiftyLink
generally takes this into account, but some programs are particularly
sensitive in this regard. That's why there is the special command
{DELAY n}, which can be used like a keyboard
command. || tells the program to wait until a
new window is open (max. 60 seconds).
Translation
You can create a new language file by translating an
existing one. The file format is UTF-8 with BOM. To use the new language,
enter it in the INI file. Please also send the
language file to <support {AT} luethje {DOT} eu>.
The next version of NiftyLink will then support
this language automatically. Don't forget to write your name and e-mail
address at the beginning of the file.
Credits
This program was written in
PureBasic. Thanks to Fantaisie Software for this good
general purpose programming language, and thanks to Philip Hazel for the
PCRE library.
This program uses the PureBasic library "AutoWin" (in slightly
modified form). Thanks for that to Thomas Schulz.
The setup version of this program was built with
Bytessence InstallMaker. Thanks to Alexandru Trutia
for this good free program.
Special thanks to the Total Commander forum member sgp for
thoroughly testing the program, and for good suggestions for improvement.
License
See file License.rtf
Contact
This software can be downloaded from
http://luethje.eu/prog/. If you are in doubt whether you have got
an original, unaltered copy of the file
niftylink110.zip or
niftylink110_setup_en.exe, calculate its
MD5 checksum. It must be equal to the one published on my
website.
Please post questions, suggestions, and bug reports on
http://www.ghisler.ch/board/viewtopic.php?t=27577
or mail to <support {AT} luethje {DOT}
eu>.
J. Lüthje, 22. July 2012