Scripting Q&A for n00bs
Posted: 17 Oct 2016, 07:37
The filebot command-line tools are simple and some command-line skills will get you a long way. The Cmdline and Argument Passing docs explain and illustrate the typical issues and concepts that new users (and advanced users) inevitable stumble over from time to time.
Common Pitfalls:
Tips & Tricks:
Common Pitfalls:
- $PATH not set resulting in filebot: command not found issues (hard to find if you don't see the console error output)
- Not quoting arguments that contain spaces > C:/Program Files/FileBot/filebot.exe -version ⇨ C:/Program: command not found
- Not escaping quotes in quoted arguments (--format "..."..."...")
- Accidentally escaping arguments (filebot -rename "C:\files\" --action test)
- “...” being used instead of "..." (apparently some command-line calls are written in Microsoft Word or Apple Pages)
- '...' used to quote arguments on Windows (blind copy & paste from examples for Linux or Mac)
- Literally passing in %D or %F as input arguments (filebot cannot magically resolve substitution patterns from 3rd party programs)
- Permission issues on Linux (always tricky but never an issue specific to filebot)
- The process cannot access the file because it is being used by another process issues on Windows (wretched OS limitations)
Tips & Tricks:
- Use the @file syntax for reading cmdline args from text files so you don't have to worry about quoting and escaping arguments
- Read Cmdline and Argument Passing and play with it yourself using filebot -script fn:sysenv
- Read Shell Script Debugging for Beginners and learn how to to use IO Redirection