Multi Commander Support Forum

Multi Commander => Script => Topic started by: Jean on March 08, 2020, 12:13:03

Title: send selected files to a program in the 'send to' list
Post by: Jean on March 08, 2020, 12:13:03
Back at multicommander after a trial of directory opus. Glad to be back, i prefer MC, not only money wise.

Is it possible to send selected files to a program in the 'send to' list by a script?
Another solution for me would be the ability to assign a key to that specific program in the 'send to' list.
The whole idea is that i'd like to send selected files to a utility with just one keystroke.
Title: Re: send selected files to a program in the 'send to' list
Post by: Jean on March 08, 2020, 13:33:54
If someone is looking for a way to do this, this works for me.

Code: [Select]
@var $files = GetSelectedPaths(), $n;
@var $s = "";
for( $n=0; $n<arrayCount($files); $n++ )
  {
  $s = $s + "\"" + $files[$n] + "\" ";
  }
$s = "c:\myprog.exe " + $s;
MC.Run CMD={$s}
Title: Re: send selected files to a program in the 'send to' list
Post by: Mathias (Author) on March 09, 2020, 09:22:08
or

Code: [Select]
@var $selectedItems = GetSelectedPaths();
@var $selected = ArrayToString( $selectedItems , "  ", 1 ); // space separated list with all selected items

@var $cmd = "c:\myprog.exe " + $selected;
MC.Run CMD={$cmd}
Title: Re: send selected files to a program in the 'send to' list
Post by: Jean on March 09, 2020, 13:04:46
great, thank you.