Author Topic: File viewer for focused file  (Read 12083 times)

halifax80

  • Newbie
  • *
  • Posts: 10
    • View Profile
File viewer for focused file
« on: September 19, 2014, 19:46:59 »
Hi,
I'm a new user of Multi Commander and I managed to replicate almost every functionality I used to use in Altap Salamander, but I have a few problems. One of them is the following:
I configured IrfanView as an External Program in File Type Setup for JPG files.
Let's imagine I have 4 JPG files in a folder. 3 of them are selected. I focus on the 4th file and press F3. The desired behavior is to view the 4th file in IrfanView. But this does not happen. Instead, the 1st selected file is shown in IrfanView. This happens because MC passes the list of selected files to IrfanView, and not the focused file.
This problem has partly already been discussed here: http://forum.multicommander.com/forum/index.php/topic,1121.msg3810.html This post tells that ${focusfilepath} is (sadly) not available in File Type Setup.
My question is: is there any way to get my desired behavior? (Show focused file in external viewer.)
It does not make too much sense anyway to pass the list of selected files to IrfanView, since it can only show 1 image, and then you can use the cursor buttons within IrfanView to navigate between files
Regards,

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4386
    • View Profile
    • Multi Commander
Re: File viewer for focused file
« Reply #1 on: September 20, 2014, 16:10:04 »
Yes it uses selected files, and normally focused file are one of the selected.
But I will test if focused file should be included first in the list of files to be viewed. Might be that there are other issues that will pop up if that is changed.

The other forum post talk about script and the script tags can not be used in the filetype setup.
But you can do the other way around. Create a script that calls the view command with the focused file.

CustomCommand type of UserDefinedCommand..
Code: [Select]
MC.View FILE="${focusfilepath}"Then assign that command to a hotkey.


halifax80

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: File viewer for focused file
« Reply #2 on: September 21, 2014, 01:05:21 »
Thanks Mathias for your reply. Actually, I suspected that I can do it with a script, but I'm a novice in MC scripting.
I created the UserDefinedCommand that you suggested, and assigned it to Hotkey F3. Now it works like a charm.
Thanks for the help, again. This workaround solved my problem.