AMC & --def exec=command & mkvmerge

Any questions? Need some help?
Post Reply
User avatar
rednoah
The Source
Posts: 22978
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC & --def exec=command & mkvmerge

Post by rednoah »

What does the console output say?
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22978
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC & --def exec=command & mkvmerge

Post by rednoah »

1. Create a test folders with a few test files
2. Open CMD
3. Run the amc script with your custom options on your test folder and see what the output says
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22978
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC & --def exec=command & mkvmerge

Post by rednoah »

Is this really the command you want to execute? Because you aren't passing in any files or folders...

Code: Select all

Execute: D:/Desktop/test3/mkvmerge.bat

Try the example from the manual and see what's different:

Code: Select all

--def exec="echo {quote f}"
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22978
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC & --def exec=command & mkvmerge

Post by rednoah »

Let's assume that your script works like this:

Code: Select all

D:/Desktop/test3/mkvmerge.bat "/path/to/file"
Then the corresponding exec expression would look like this:

Code: Select all

D:/Desktop/test3/mkvmerge.bat {quote f}
It's a format expression, which yields a command, which is executed.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22978
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC & --def exec=command & mkvmerge

Post by rednoah »

How does your bat script work? Does it accept individual files being passed in? When you manually use the bat script, how do you use? What does the command-line look like? Examples, please. ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22978
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC & --def exec=command & mkvmerge

Post by rednoah »

You'll need to rewrite your script so that it processes the files passed in via arguments, and not files in the current directory, because the current directory won't be what you want it to be.

You'll probably want to just call mkvmerge directly, and not via some strange script that relies on the current working directory:

Code: Select all

--def exec="mkvmerge <your options>"
First you understand how mkvmerge works, then you run a few trial in CMD so make sure it works the way you want, and then you just replace the test files with filebot variables for the final exec expression.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22978
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC & --def exec=command & mkvmerge

Post by rednoah »

Not really. I'd avoid bat scripts like the plague. Literally. It's bad for your physical and mental well being.

Call your script. Pass in the processed file:

Code: Select all

/path/to/myscript.ps1 {quote f}
Create your script, just echo the file that was passed in:

Code: Select all

echo $args
Once you have a script that can echo the files passed in, then you can write the rest of your script and do the mkvmerge && rm && mv logic. You'll just need to learn a little bit of PowerShell. Use PowerShell, not CMD, trust me. Google will help.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22978
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC & --def exec=command & mkvmerge

Post by rednoah »

Yes. But since you don't know how PowerShell works yet, you'll be much quicker by first writing a PowerShell script that you can test instantly, instead of running filebot amc hundreds of times for testing, which would be a very inefficient way to play and learn. ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22978
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC & --def exec=command & mkvmerge

Post by rednoah »

--def exec expects one PowerShell command-line, so you need to learn PowerShell basics if you want to execute multiple commands.

e.g.

Code: Select all

(command1) -and (command2)
@see https://stackoverflow.com/a/564092/1514467


:idea: I highly recommend starting with PowerShell basics, and only moving on to integrating what you have learned with --def exec once you can run your command yourself in PowerShell. Blind random trial and error will most likely end in failure.
:idea: Please read the FAQ and How to Request Help.
Post Reply