Multi Commander Support Forum

Multi Commander => Support and Feedback => Topic started by: Novice777 on October 11, 2023, 05:03:24

Title: Go to first file
Post by: Novice777 on October 11, 2023, 05:03:24
I decided to switch from Total Commander, but I couldn't create a custom command to get the focus on the first file below all the folders in the pane. This command is critical since I often have many folders, and I need to go to the first file below all the folders quickly.

Is there any way or shortcut to go to the first file on my pane?
Title: Re: Go to first file
Post by: Jungle on October 11, 2023, 20:27:15
You may create user defined command of type "Multi-Script" and bind it a to a shortcut or/and put it to the quicklaunch bar or button bar.

Code: [Select]
@var $src_path = GetSourcePath();
@var $names = GetSourceItems();

@var $count = arrayCount( $names );
@var $i;

for( $i = 0; $i < $count; $i++ )
{
  @var $file = $src_path ^ $names[ $i ];
  @var $result = FileExists( $file );
 
  if ( 1 == $result )
  {
    MC.Explorer.SetItemFocus ITEM="{$names[ $i ]}"
    break;
  }
}

I'm not sure about performance in case of too many files/folders. Also I haven't tested it with different sorting styles.