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
User avatar
fenix_productions
Power Member
Power Member
Posts: 1979
Joined: 2005-08-07, 13:23 UTC
Location: Poland
Contact:

Post by *fenix_productions »

Juergen wrote:2fenix_productions
Maybe you mean someone else? I didn't write anything about Explorer here. :)
Well...
Juergen wrote: 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?
"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 »

fenix_productions wrote:
Juergen wrote:2fenix_productions
Maybe you mean someone else? I didn't write anything about Explorer here. :)
Well...
Juergen wrote: 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?
Yes, I had asked that question. And 10 minutes later it had been answered by Vochomurka. I'm sorry, but I didn't know that the purpose of your post was to answer that "old" question again.
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 »

sgp wrote:I tried the textline plugin trick on Win7 but it display anything here
I have the W7x64, too. Only problem with the TextLine plugin is that it can't display lines with number more than 10, but it's by design. Line 2 is displayed flawlessly as I've written.
I'm not sure how to setup your other suggestion using Explorer
Frankly, me too :oops: . I've just heard about it.
Single user license #329241
PowerPro scripts for Total Commander
Juergen
Power Member
Power Member
Posts: 517
Joined: 2003-05-02, 18:19 UTC
Location: Berlin (Germany)
Contact:

Post by *Juergen »

A new version of the program is available now (download link in first post of this thread).

Fixed
The program now can read the internal associations of TC even when the [Associations] section is redirected from the main INI file to a separate file.

Changed
- The extension for FlexLinks to directories has been changed from ".fld" to "._x", so that these FlexLinks are at the beginning of the file list (or at the end, respectively), when the file list is sorted according to the extension.
The extension for FlexLinks to files has been changed from ".flx" to ".fx".
- Some details.
- Enhanced documentation.


2sgp:
In my tests, the previous version ran flawlessly on Win 7 on a somewhat old and slow machine. So I suppose the problem was, that your machine is too fast. :) In this version, there is a short delay before the program sends ENTER to TC's address bar. Please tell me whether it works now for you.

Regards, Jürgen
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 »

Sorry for the delay in answering, but I'm traveling. Anyway, yes now the ENTER key seems to work on Win7. However, flexlinks to files don't start the target file anymore. The .fx file is created properly, and its content is the right relative path, but when I double-click I get 'Windows can't find ..\..\whatever\file.ext. Make sure you typed the name correctly' etc.
I tried with ext=ZIP and ext=txt. Neither one worked.
Juergen
Power Member
Power Member
Posts: 517
Joined: 2003-05-02, 18:19 UTC
Location: Berlin (Germany)
Contact:

Post by *Juergen »

Hi sgp,

thanks for your feedback, it's much appreciated. And sorry for any inconveniences with the previous version. Could you please try the new version 0.75 (download link in first post)? I made numerous tests with it, and everything worked as expected here.

Fixed
A bug when executing relative links.

New
Optional INI file for defining shortcuts and for specifying key combinations, so that a FlexLink can directly open a particular page in a document.

The program now has an INI file that looks like this:

Code: Select all

[Shortcuts]
doi = http://dx.doi.org/
rfc = http://www.faqs.org/rfcs/rfc

[PDF page]
Adobe Reader = {SHIFTDOWN}{CONTROLDOWN}n{SHIFTUP}{CONTROLUP}
PDF-XChange Viewer = {SHIFTDOWN}{CONTROLDOWN}n{SHIFTUP}{CONTROLUP}
The entries in the Shortcuts section mean, that a FlexLink e.g. can look like this:

Code: Select all

[FlexLink]
Target=rfc:2822
Double-clicking on that FlexLink will open the URL http://www.faqs.org/rfcs/rfc2822 .

The next section means, that a FlexLink to a PDF file can contain an entry with a page number, e.g.

Code: Select all

[FlexLink]
Target="D:\Daten\Juergen\Eigene Dateien\Textbook.pdf"
Page=250
When that PDF file is opened with Acrobat Reader or with PDF-XChange Viewer, the given page number will be shown. Respective entries for other file types and programs can be added to the INI file.
This is very useful, when you e.g. have a complete textbook as PDF file (not seldom these days), and you want to link directly to a particular chapter.

The documentation of the program is not yet complete, sorry.

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 »

Hi Juergen, sorry but version 0.75 has several issues - tested on Win7. Some of which might have to do with my configuration, which is perfectly legitimate, but it might not match yours.

1. I tried the new Page= entry for pdf with X-Change viewer. It's a nice idea, BTW. However, there seems to be a timing issue. Some times, if the viewer isn't already running, it gets started with the flexlink target file but the goto page seems to be ignored. All the times, if the viewer is already running, and the flexlink target is already open, a page-goto dialog is displayed but it stops there, i.e., the page number is always 1 and ENTER isn't automatically pressed.

2. I clicked a relative flexlink to a pdf file, where the system and portable associations to pdf files coincide - I mean that they point to the same program for viewing pdf files - it worked.

3. I clicked a relative flexlink to an ini file, where the system and portable associations to ini files coincide, and they point to notepad.exe - but note that notepad.exe is then redirected to notepad2.exe on my system via special registry entry. It didn't work (Windows can't find ..\..\bla bla)

3.1 I clicked an absolute flexlink to the same ini file. This time it worked.

4. I clicked a relative flexlink to an ZIP file, where the system and portable associations to zip files do NOT coincide, and the portable zipper program is missing, but the system one exists. I got the usual error message. It makes sense, but note that TC behaves differently in this case. It opens zip files internally, and not in an external program. To me it would be more useful if flexlinks to archive files for which a packer plugin exists were opened internally, like TC does.

4.1 I clicked an absolute flexlink to the same ZIP file. This time the system zipper program was started. This hardly makes sense to me.
Juergen
Power Member
Power Member
Posts: 517
Joined: 2003-05-02, 18:19 UTC
Location: Berlin (Germany)
Contact:

Post by *Juergen »

Hi sgp,

thanks again for your detailed report, and please excuse the delay in replying. I changed several details in the code, and I hope I was able to address the issues that you mentioned (download link for new version 0.77 is in the first post).

Best regards, Juergen
My add-ons and plugins for TC: NiftyLink, mbox, Sequences
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Juergen, could you document what subset of TC search do you support?
I see that a simple *.ext works, but a regular expression doesn't (I use mostly regexs) and would like to know where are the limits.
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

sgp wrote:
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.
Each link contains 2 fields with a target paths, full and relative ones. If you fill only the relative one, you have almost a regular .lnk. Almost, because last time I checked, target icon was not resolved.

The fixing of links triggers only when they contain an invalid path, if there is only a valid, relative one, it just works.

I wrote a tool to create such links some time ago, but don't have access to backup right now. Anyway, it was a piece of cake.
Juergen
Power Member
Power Member
Posts: 517
Joined: 2003-05-02, 18:19 UTC
Location: Berlin (Germany)
Contact:

Post by *Juergen »

m^2 wrote:Juergen, could you document what subset of TC search do you support?
I see that a simple *.ext works, but a regular expression doesn't (I use mostly regexs) and would like to know where are the limits.
The documentation is not yet complete, I'm sorry. I hope I can describe it properly in English. :-)

FlexLinks to directories
When you press the [Shift] key while double-clicking at a FlexLink to a directory, the directory will always be opened in a new tab.

FlexLinks to files
If a FlexLink contains neither [face=courier]<system>[/face] nor a program name, then [face=courier]WinCmd.ini[/face] is searched for an apropriate program for opening the linked file (even when the concerning sections of [face=courier]WinCmd.ini[/face] are redirected).
  • Highest priority has the search for a corresponding packer, according to the file extension. Firstly the section [Packer] is searched, then the section [PackerPlugins].
  • Next priority has the search for a pattern in the section [Associations], that matches the name of the linked file, where
    * matches any zero or more characters,
    ? matches any single character.
    Also lists of different patterns such as
    [face=courier]*.ini;*.txt[/face]
    are supported.
    Regular Expressions are (currently) not supported.
  • Lowest Priority has the command, with which the linked file is associated in the operating system.
When you press the [Shift] key while double-clicking at a FlexLink to a file, then the next available command with a lower priority is executed.

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 »

Hi Juergen, good progress with 0.77! I tested again the issues I reported earlier, both on XP and W7. Page= for pdf with exchange viewer works now. So do relative flexlinks to .ini files. Flexlinks to .zip files work but there's another issue. On my PC clicking a flexlink opens the zip file in the internally associated zip program (or in the system one, I can't tell the difference). Instead .zip should open in TC's internal packer. I'm guessing that your code expects .zip to be included in the [Packer] or [PackerPlugins] sections, which isn't mandatory for TC. Look at my configuration below. .zip is not mentioned, and TC still opens .zip files in its internal unpacker. Flexlinks should work the same way, I think.

Code: Select all

[Packerplugins]
7z=223,%COMMANDER_PATH%\plugins\7zip\7zip.wcx
CAB=223,%COMMANDER_PATH%\plugins\multiarc\multiarc.wcx
SBC=69,%COMMANDER_PATH%\plugins\multiarc\multiarc.wcx
doc=260,%COMMANDER_PATH%\plugins\multiarc\multiarc.wcx 
ppt=260,%COMMANDER_PATH%\plugins\multiarc\multiarc.wcx 
xls=260,%COMMANDER_PATH%\plugins\multiarc\multiarc.wcx 
bz2=69,%COMMANDER_PATH%\plugins\multiarc\multiarc.wcx 
multiarc=223,%COMMANDER_PATH%\plugins\multiarc\multiarc.wcx
uha=5,%COMMANDER_PATH%\plugins\multiarc\multiarc.wcx 
mht=415,%COMMANDER_PATH%\plugins\wcx\MhtUnPack\MhtUnPack.wcx
mhtml=415,%COMMANDER_PATH%\plugins\wcx\MhtUnPack\MhtUnPack.wcx
msg=415,%COMMANDER_PATH%\plugins\wcx\MhtUnPack\MhtUnPack.wcx
b64=415,%COMMANDER_PATH%\plugins\wcx\MhtUnPack\MhtUnPack.wcx
chm=479,%COMMANDER_PATH%\plugins\wcx\CHMDir.wcx
its=479,%COMMANDER_PATH%\plugins\wcx\CHMDir.wcx
[Packer]
LastUsedPacker=1
RAR=%COMMANDER_PATH%\packers\RAR\Rar.exe
Juergen
Power Member
Power Member
Posts: 517
Joined: 2003-05-02, 18:19 UTC
Location: Berlin (Germany)
Contact:

Post by *Juergen »

Hi,

I am very sorry for the long delay! It was due to some private problems.

@sgp:
I'm happy that most of the issues had been fixed in the previous version. And thank you for the information about handling of ZIP archives, which I actually didn't know.
So I changed handling of ZIP archives by FlexLink as well. In the first post, there is a d/l link to the new version 0.78. I hope that works correctly now.

Kind regards, and a happy new year,

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, thank you very much. Good fix, version 0.78 works correctly with zip files!
lio
Junior Member
Junior Member
Posts: 5
Joined: 2011-01-20, 08:39 UTC
Location: Italy

Support for file system plugins and internal commads

Post by *lio »

After a long search (many years) for relative path soft link support by the OS (I don't know why Microsoft have never added relative path support to .lnk files), I found your GREAT and very useful extension.

I have some requests:
  • Support for file system plugins:
    I would like to create flexlinks to a WEBDAV folders like:

    Code: Select all

    \\\WebDAV\my_connection
    or better:

    Code: Select all

    \\\WebDAV\my_connection\my_path
  • Support for Total Commander internal commands:
    This functionality can be used to achieve the previous request.
    For example if FlexLink will support the internal CD command, we can create the following flexlink:

    Code: Select all

    [FlexLink]
    Target=CD \\\WebDAV\my_connection
  • Support for customized flexlink default extension.
    I don't like the current default flexlink extensions:

    Code: Select all

    fx for flexlinks to files
    _x for flexlinks to directories
    I already configured TC internal association with different extensions, but I need to remember my custom extension in order to replace the default extension provided by flexlink.
    For example, when I create a flexlink to a directory, the flexlink dialog prompt me with the default extension (._x):

    Code: Select all

    flexlink_name._x
    and I need to change it to my custom extension (.fld):

    Code: Select all

    flexlink_name.fld
  • The last request is to release the FlexLink source code to the community (under GPL)
    In this way more people can contribute to this useful extension
Thanks again for your effort.
Post Reply