Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - force_redo

Pages: [1]
1
Script / Re: Copy and convert audio. Can I do this as a script?
« on: November 18, 2017, 20:05:48 »
Hi Reset,

it was an old post, but I hadn't solved it myself yet. With your help and a bit of copy & paste I came up with this now, which does the trick for the selected files in the current directory. No idea how this would work with recursive subdirectories, but this does the trick for now:

Code: [Select]
@var $arr = GetSourceSelectedPaths();
@var $items = arrayCount($arr);
@var $path = GetTargetPath();

@var $SourceFile
@var $s
@var $name

@var $n = 0;

//loop

for( $n = 0; $n < $items; $n++ )
{
  $SourceFile = $arr[ $n ];
  $name = PathGetNamePart($SourceFile, 1);
  $s =' -i ' + '"' + $SourceFile + '" ' + '-map a "' + $path + $name + '.mp3"';
  MC.Run CMD="C:\Program Files\ffmpeg\bin\ffmpeg.exe" ARG="{$s}"

}

P.S.: What is the difference between GetSelectedPaths and GetSourceSelectedPaths? The documentation says:
"An array of the complete paths for all the selected files and folders in the source view" for one
and
"Get an array with the full paths of all selected items in the source view" for the other.

Thanks again!

2
Script / Copy and convert audio. Can I do this as a script?
« on: January 08, 2016, 20:32:53 »
Hi,

I have a little problem that I hope the Multi Commander scripting could help me with but I'm not much of a programmer. I was hoping someone here could help me with this.

- I have an old mp3 player that really only plays mp3 files, no other formats.
- I regularly download podcasts, but not all of them come as mp3 format. Some are m4a etc.

So, what I would like to do is to have a script that copies all files (recursively) from one place to another as long as they're mp3s. If they're not, it should convert it to mp3 and then copy it. (e.g. via lame with some standard settings)
In other words the resulting file/folder structure should look like the source, only that all files are mp3 files.

Is this possible with scripting?

Thanks a lot in advance!
FR

Pages: [1]