NiftyLink addon - Links using internal associations and more

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Juergen
Power Member
Power Member
Posts: 517
Joined: 2003-05-02, 18:19 UTC
Location: Berlin (Germany)
Contact:

NiftyLink addon - Links using internal associations and more

Post by *Juergen »

Hi all,

I've written a Freeware add-on for TC 7.50+ called NiftyLink.

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. 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 inTotal 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 TC 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.
    ( New interpretation of WYSIWYG: What you see is where you go. :) )
  • NiftyLinks work on any file system (FAT, NTFS) that is supported by Windows.
Additional functions in Total Commander
  • Extended dialog for creation of NiftyLinks.
  • NiftyLinks to directories and archieves 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 provied by filesystem plugins.
  • With the content plugin "Text Line", the content of NiftyLinks can be displayed as tooltip.
    (Thanks to Vochomurka for this tip, and thanks to the authors of Text Line!)
Image: http://luethje.eu/prog/niftylink110_en_tc.png

Download the current version of NiftyLink from my website.

For details how to install and use the program please see the documentation.
Please post your questions, suggestions, and bug reports here in this thread.

Enjoy!

Regards, Jürgen
Last edited by Juergen on 2012-07-22, 19:39 UTC, edited 27 times in total.
My add-ons and plugins for TC: NiftyLink, mbox, Sequences
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Windows 7 has symbolic links that support relative paths. :)
Juergen
Power Member
Power Member
Posts: 517
Joined: 2003-05-02, 18:19 UTC
Location: Berlin (Germany)
Contact:

Post by *Juergen »

MVV wrote:Windows 7 has symbolic links that support relative paths. :)
And what if you have an USB drive with symbolic links, and want to use the drive on a system with Windows XP?
My add-ons and plugins for TC: NiftyLink, mbox, Sequences
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Interesting. :)
I didn't check that. But I'll try. :D
I think XP will show folder but won't be able to enter it.


BTW why you don't use standard LNK files? They can also contain relative path (you just need to find a way to specify relative path) and they are supported by OS internally. Also icon file may be associated with LNK. Or simple BAT/CMD file can be used as flexible link - even more, it can act as script.
Juergen
Power Member
Power Member
Posts: 517
Joined: 2003-05-02, 18:19 UTC
Location: Berlin (Germany)
Contact:

Post by *Juergen »

MVV wrote:Interesting. :)
I didn't check that. But I'll try.
Please tell me the results.
Also please tell me how a symbolic link can be used, to open a document with the command to which it is associated internally in TC.
MVV wrote:BTW why you don't use standard LNK files? They can also contain relative path
You think so? Then please tell me how this can exactly be done.
Also please tell me how a LNK file can be used, to open a document with the command to which it is associated internally in TC.
MVV wrote:Or simple BAT/CMD file can be used as flexible link
Please tell me how a BAT or CMD file can be used, to open a document with the command to which it is associated internally in TC.
My add-ons and plugins for TC: NiftyLink, mbox, Sequences
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

MVV wrote:BTW why you don't use standard LNK files? They can also contain relative path (you just need to find a way to specify relative path) and they are supported by OS internally. Also icon file may be associated with LNK.
I'm skeptical that using LNK files as relative paths would work well. I could be wrong, but as far as I remember Windows resolves LNK files when you click them. While it resolves them, Windows can decide they are "broken" and "fix" them, that is by permanently changing the target they point to - if a new target can be found according to Windows LNK rules. I can imagine what uncontrollable mess of your carefully specified relative links Windows would make at that point.

But in principle, if one could intercept keypresses and mouse clicks that are directed to LNK files, then the LNK file structure could be a valid storage container for relative links, with the advantage that it can store an icon. After the keypress/click the intercept routine should resolve and run the relative link.
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

@Juergen, any chance for mouseover to show the resolved path in a tooltip?
Juergen
Power Member
Power Member
Posts: 517
Joined: 2003-05-02, 18:19 UTC
Location: Berlin (Germany)
Contact:

Post by *Juergen »

2sgp:
This is a nice idea, thank you!
Unfortunately, at the moment I don't know how this could be implemented.
Is there an internal TC function that my program can call for this purpose?

Regards, Juergen
My add-ons and plugins for TC: NiftyLink, mbox, Sequences
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Actually, not internal.
First way is to use the Windows explorer property to show some first lines of *.txt (say) files. Second way is to use the TextLine plugin:
1) Install the TextLine plugin;
2) Configuration \ Display \ User-defined (plus button on the bottom right corner);
3) Add;
4) *.flx, *fld;
5) Field: [=textline.2] (that is, show the second line of the *.fl? files as tooltips).
Single user license #329241
PowerPro scripts for Total Commander
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Juergen wrote:
MVV wrote:Windows 7 has symbolic links that support relative paths. :)
And what if you have an USB drive with symbolic links, and want to use the drive on a system with Windows XP?
I'd create a folder on the C drive:
C:\USB\MyUSB1
Then:
MountVol.exe C:\USB\MyUSB1 \\?\Volume{37632a8b-ba22-11gh-1608-000c41b567d3}\

Then use junctions from there/with that path as needed.

When using the USB on a 'foreign' machine, make the folder there, and mount the USB drive again. This could even be a batch script (to create the folder, and mountvol), since the volumeID wont change.

And whenever you plug the USB drive into your machine that folder will automatically be valid/mounted and parseable.


For Win2K I did something very similiar so that I could install the OS into the paths and drives that I wanted to. Pre-prep the drive so it contains:
C:\MntHD\HDa0
C:\MntHD\HDa1
C:\MntHD\HDa2
C:\MntHD\HDa3

All of those folders are mounted to volumes. (of which none of those volumes have been assigned a drive letter).

Then:
Junction "C:\Program Files" "C:\mntHD\HDa3\Win2K_Bin\_C_"
Junction "C:\Users" "C:\mntHD\HDa3\Win2K_Usr\_C_"

On My D Drive,
Junction "D:\Program Files" "C:\mntHD\HDa3\WinXP_Bin\_D_"
Junction "D:\Users" "C:\mntHD\HDa3\WinXP_Usr\_D_"

On My E Drive,
Junction "E:\Program Files" "C:\mntHD\HDa3\Win7_Bin\_E_"
Junction "E:\Users" "C:\mntHD\HDa3\Win7_Usr\_E_"
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

@Juergen, On Win7 doube-clicking a .fld file sends the relative path to the address bar without a final ENTER, so no change directory takes place. Possibly ENTER is sent indeed, but with the wrong timing. I suspect that Win7 is more picky about stuffing keys than WinXP is.

@Vochomurka, I tried the textline plugin trick on Win7 but it display anything here. Also, I'd prefer for the tooltip to show a _resolved_ link, not just a relative path.
I'm not sure how to setup your other suggestion using Explorer.
Juergen
Power Member
Power Member
Posts: 517
Joined: 2003-05-02, 18:19 UTC
Location: Berlin (Germany)
Contact:

Post by *Juergen »

2Vochomurka
That's cool, thank you!

2Balderstrom
I think using mount points and doing without drive letters is a good idea for using USB drives on my own machine. On other people's computers, I want to just plug in my USB drive and use it, without changing anything on that computer.

Anyway, double clicking on a symbolic link, a LNK file or a junction to a document will open that document with the program, to which it is associated on the respective Windows system, no?

In contrast, double clicking on a FlexLink to a document will open that document with the program, to which it is associated internally in Total Commander, if such a internal association exists. Otherwise, the document will be opened with the program, to which it is associated on the respective Windows system.
Also, a FlexLink to a directory can open that directory in a new tab in the current panel of TC or in the other panel (currently only possible by manually editing the .fld file: replace <newtab> with <newtabother>). I don't think that this is possible with a symbolic link, a LNK file or a junction.

2sgp
The TextLine plugin works well here on my system (although it doesn't seem to support UTF-8, so that target file names in a FlexLink that contain e.g. our funny German umlauts will not be displayed correctly).
Yes, the plugin just shows the respective line of the file "as is". But now I know how to do it, and I can write a similar plugin that will resolve the path before it will be displayd. However, this would be some extra amount of work, and currently I want to concentrate on the FlexLink program itself.

Thank you for reporting the problem with Win 7. Yes, on principle always a final ENTER is sent in that situation. I'll see where I can do some tests on a Win 7 machine.

Regards, Juergen
My add-ons and plugins for TC: NiftyLink, mbox, Sequences
sgp
Senior Member
Senior Member
Posts: 355
Joined: 2005-01-31, 16:04 UTC

Post by *sgp »

Juergen wrote:In contrast, double clicking on a FlexLink to a document will open that document with the program, to which it is associated internally in Total Commander, if such a internal association exists.
And that's the main reason I find your program useful, since I use internal file associations extensively.
May I suggest that you add a note about this program to the wiki here http://www.ghisler.ch/wiki/index.php?title=Internal_File_Associations_Tutorial
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

2Juergen
You don't need to play with Explorer for tooltips.

If you provide your own WDX plugin for flx, fld files properties, then it can be used for "User defined" tooltips within TC interface.
"When we created the poke, we thought it would be cool to have a feature without any specific purpose." Facebook...

#128099
Juergen
Power Member
Power Member
Posts: 517
Joined: 2003-05-02, 18:19 UTC
Location: Berlin (Germany)
Contact:

Post by *Juergen »

sgp wrote:
Juergen wrote:In contrast, double clicking on a FlexLink to a document will open that document with the program, to which it is associated internally in Total Commander, if such a internal association exists.
And that's the main reason I find your program useful, since I use internal file associations extensively.
I agree, and I'll lay more emphasis on this point in the documentation of the program.
sgp wrote:May I suggest that you add a note about this program to the wiki here http://www.ghisler.ch/wiki/index.php?title=Internal_File_Associations_Tutorial
Done. :) Please feel free to correct/change it if necessary.

Thanks for the suggestion. By reading the tutorial I realized, that I had forgotten about Total Commander's ability to put an INI section into a separate file! In this case, my program will not work correctly anymore. Well, this issue can be easily corrected in the next version of the addon.


2fenix_productions
Maybe you mean someone else? I didn't write anything about Explorer here. :)

Regards, Juergen
My add-ons and plugins for TC: NiftyLink, mbox, Sequences
Post Reply